MySQL Forums
Forum List  »  Microsoft Access

Time Difference
Posted by: Julie Bressler
Date: September 03, 2009 03:33PM

I have a table that records the following information: (Linking with an Access 2003 database)

Work Date
Time In
Time Out
Project
Total Hours
Notes

After the user updates the <Time In> & <Time Out>, the form automatically updates the number of hours between the time in & time out...


DateDiff("n",[TimeIn],[TimeOut])/60

It works great the first time. However, if the user realizes they entered the wrong time. For example, they entered 7pm & it should have been 7:30pm. When they go back in to the form and change the time, the datediff doesn't work. It has some number like 982123. Huge number. But if you delete the <Time Out> & re-enter - it then calculates correctly.

I've almost given up on it if a user needs to make changes. Just make them delete the row & re-enter the time. (Since that works) It is only when they need to correct a mistake.

Also, What would be the correct variable type for the <TimeIn> & <TimeOut> field on MySQL? Should it be Datetime? Or just Time?

Thank You

Options: ReplyQuote


Subject
Views
Written By
Posted
Time Difference
4170
September 03, 2009 03:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.