#Func! Calculating difference between times

guinness

Registered User.
Local time
Today, 15:23
Joined
Mar 15, 2011
Messages
249
Hi all,

I'm returning to access after quite some time and discovering that I have forgotten how to do even basic stuff. I am starting to create a resourcing database that needs to be able to work with dates and times and perform calculations on them.

I need to work out the number of hours. I have two date/time fields Day_Start_Time and Day_End_Time. I want to calculate the difference between the two in hours and then multiply by the number of working days. I tried this: Number_Of_Hours: DateDiff("hh",[Day_Start_Time],[Day_End_Time])*[Number_of_days] but get #Func! when I run the query.

I'm probably missing something very basic (like a knowledge of Access) but can anyone help?

Thanks in advance

Kev
 
Last edited:
See this for syntax and examples of DateDiff().

What exactly does the *[Number_of_days], mean?
 
Number_of_days is the amount of working days (took ages to get that to work, ended up copying someone elses VBA code without any real idea how 0or why it worked). So I had a start time and an end time to give me an amount of hours per day then multiplied by the amount of working days.

I got the code sorted Number_Of_Hours: DateDiff("h",[Day_Start_Time],[Day_End_Time])*[Work Days]

I had an extra "h"

Thanks again
 
Glad you have it working.
 

Users who are viewing this thread

Back
Top Bottom