1. Registered User
Join Date
Feb 2008
Posts
28

Hello,

I have a query in which I have a field for a Start Time and one for an End Time. Can someone help with a calculation and expression (and where in the query it should go) to determine Hours Worked? There are no breaks or non billed time between Start Time and End Time. I just need to tell access to show me 1 hour worked if someone starts at 5 pm and finishes at 6 pm.

Thanks

2. L33t Helpa Munky
Join Date
Nov 2007
Location
Posts
4,049
[End Time] - [Start Time]

Then format the result to hours using the Format property.

3. Registered User
Join Date
Feb 2008
Posts
28

## Time

Thanks for your help with the formatting. I have done this, but I cannot seem to properly record that 1.5 hours took place. How do i convert between a base 60 and a base 10 system of time and decimal?

4. L33t Helpa Munky
Join Date
Nov 2007
Location
Posts
4,049
When you do the subtraction, you'll get a result such as 0.0625. This represents the faction of a day that there is between the two dates. Formatting to "h:nn" would show 1:30... one hour and 30 minutes.

If you want it to be 1.5 then you have to use math to convert days to hours... ei Multiply by 24.

5. Registered User
Join Date
Jul 2003
Location
Amsterdam, Nederland
Posts
450

## RE:Calculate hours display in decimals

startdate = 1 march 2008 09:00:01
enddate = 1 march 2008 11:30:45

if you do a datediff("n",startdate,enddate) 'where n stands for minuts

Result = 150 '(min)

if you want it in a fraction then divide it by 60
150 / 60 =2.5

1 0 1 elementry school stuf

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•