PDA

View Full Version : Time



Scooter172
09-29-2012, 08:33 PM
I have a table that has two columns.., start time and stop time. I want to have a calculated Column that subtracts one from the other. BUT access gives me the percentage of the day decimal and I would like it calculated and appear as 7.2 etc Hour plus tenths of hour. I want to be able to enter data in the table using a form but in order for me to calculate that work day which starts at 2:00 AM and ends at 2:30 am I run into date time issues. I am new to access (less than 1 year) and could use some guidance. :beerchug:

hansup
09-30-2012, 10:19 AM
Subtracting one Date/Time value from another will give you a float value for the difference between them in days. Multiply by 24 to determine the number of hours that represents.

? (#02:30# - #02:00#) * 24
0.5

You could use the DateDiff() function instead. Ask DateDiff() for the number of minutes between 2 Date/Time values and divide the difference by 60.

? DateDiff("n", #02:00#, #02:30#) /60
0.5