UnsolvedCoding
Technical User
I am still working on a timesheet project and have been having a lot of problems getting an update query to work when calculating times. I can get it to run just fine as a select or append query but when I try to make it a select query it won't run.
This particular issue has to do with calculating the regular work hours during the day, taking the start of the day and the start of lunch to get a time and getting the end of lunch and the end of day to get a time.
I have tried Datediff but when I combine the two time segments to get total hours worked it crashes. I have tried startlunch-startday + endday-endlunch but that crashes also. And I have tried creating a query to calculate the information - which works fine, but when that query is introduced the update query crashes.
Sample of code from query that works AM_hrs: ([Time_Table]![Start_Lunch]-[Time_Table]![Start_Day])*24
Hours: DateDiff("n",[Time_Table]![Start_Day],[Time_Table]![Start_Lunch])/60
Both fail.
Anyone know a good way to calculate the times?
This particular issue has to do with calculating the regular work hours during the day, taking the start of the day and the start of lunch to get a time and getting the end of lunch and the end of day to get a time.
I have tried Datediff but when I combine the two time segments to get total hours worked it crashes. I have tried startlunch-startday + endday-endlunch but that crashes also. And I have tried creating a query to calculate the information - which works fine, but when that query is introduced the update query crashes.
Sample of code from query that works AM_hrs: ([Time_Table]![Start_Lunch]-[Time_Table]![Start_Day])*24
Hours: DateDiff("n",[Time_Table]![Start_Day],[Time_Table]![Start_Lunch])/60
Both fail.
Anyone know a good way to calculate the times?