Date / Time Calculation

ramsayaj

Registered User.
Local time
Today, 19:42
Joined
Nov 11, 2002
Messages
16
Hi there,

I have an Access form that has four fields relating to date and time:

1. Date In
2. Time In
3. Date Out
4. Time Out

I want to set up another control that displays the difference in hours between the Date In and Time In versus the Date Out and Time Out. I am struggling on working out how to do this, I have tried using DateDiff but I cannot get the Date and Time controls to be treated as one control. I know I could use the long date format and have the date and time in one control but I am trying to avoid doing this.

Can anybody help?

Many thanks,
Alan
 
Use the "+" operator to combine the two values into one value.

Here is an example:
=DateDiff("n",([Date In]+[Time In]),([Date Out]+[Time Out]))

HTH
RDH
 
Hi Ricky,

Thanks very much for the help - works a treat.

Cheers,
Alan
 
Great .... I was hoping this would do what you needed.

You are very welcome ...... :)

RDH
 

Users who are viewing this thread

Back
Top Bottom