05-18-2011 09:38 PM
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
Solved! Go to Solution.
05-18-2011 10:55 PM
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.
05-18-2011 11:49 PM
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??
05-19-2011 12:26 AM
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' "
05-19-2011 12:38 AM
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 🙂
05-19-2011 12:44 AM
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.
05-19-2011 12:49 AM
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