LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calendar

Solved!
Go to solution

Hi pros,

 

I'm doing a project related about recording data into a Microsoft Access database. My recording time is every half-an-hour and if 48 half-an-hour period has passed, I would like to store that sum of data into another table of Microsoft Access for daily recording. But I would like my data to be stored with correct date (as like the calendar from my PC). I do not want any problems for leap years etc..as my VI must be accurate. Any suggestion please? Thanks for your help.

 

Regards,

Ray

0 Kudos
Message 1 of 7
(2,557 Views)

Where exactly are you having problems? You can use one of the Timing functions (i.e. Get Date/Time String) or specify a datetime column in the table to autofill when you add a record.

0 Kudos
Message 2 of 7
(2,549 Views)

Yes, Sir. Sorry for making it confused. I did it correct for the recording data inside my table according to the PC based date. But the problem is I'm using a lot of case structure for recording data which means...

 

If the subVI recording the data for daily is equal to "7", then the sum of all data will be transferred and be written inside the "Weekly Table". But the main problem occurs here, sir. I can't decide whether every month has 4 weeks or maybe three weeks. So i definitely know that I can't use a case structure for that. Any suggestion pls??

 

0 Kudos
Message 3 of 7
(2,543 Views)
Solution
Accepted by topic author Ryamnod

I really don't understand what you are asking, and your screenshot doesn't help to clarify.

 

What you may want to look at is a function on the Timing palette called "Seconds to Date/Time".  It actually takes a timestamp and converts that into a cluster.  You can get some useful information from that such as the day of the week.  That sounds like what you may be looking for when you say "recording the data for daily is equal to '7' "

0 Kudos
Message 4 of 7
(2,539 Views)

The attached file is what I'm doing right now and the sub-VI is the clip I posted above. As you can see, when the value from shift register is equal to 7, then the sub VI will execute. I used the simplest way to write data into my table. But I am trying to create another such kind of thing to transfer data into another table. Instead of the number "7", should I put "4" for there might be 4 weeks in one month?? What about leap year?? Terribly confused about that. Please help me out... thanks a lot 🙂

0 Kudos
Message 5 of 7
(2,535 Views)

What does the "7" mean?  Is it days in a week?

 

If you want to know when the month changes, look at the month number that is in the cluster coming from the function I mentioned above (which also handles leap year automatically).  When the month is a different number than it was before, you know you have a new month.

 

If you look at the day of the week number, when the number changes from 7 back to 1, now you know you have started a new week.

Message 6 of 7
(2,533 Views)

Yep 7 means the no of days in a week.. and as you have mentioned above, the "Second to Date/Time" function is useful and will solve my problem. Thanks a lot for your help and your patience. God bless you all.. 🙂 and I will be looking forward to your helps in my future problems.

 

Regards,

Ray

0 Kudos
Message 7 of 7
(2,530 Views)