DateDiff function

Sigma248

Registered User.
Local time
Today, 15:03
Joined
Oct 6, 2008
Messages
24
I am attempting to use the DatDiff function to get the difference in hours between two type DATE variables, one is a Short Time and the other is just a standard date.

Time_1 = DateDiff("h", "rstJobs_1.Time", "Time_Off_Job")

I don't get the expected result.

e.g. If rstJobs_1.Time = 11.-00am and Time_Off_Job = 10.-00am

I would expect the result to be 1 measured in hours.

That's not what I get, I get a date returned.

What am I doing wrong?
 
What is Time_1?
 
You asked if it was funny and I said no, what's wrong with that? I keep that type of humour for the non access forums as some beginners could be put off.

Sigma doesn't say what happens but shouldn't the code be
Time_1: DateDiff("h", [rstJobs_1].[Time], [Time_Off_Job])

in a query and in vba depends on wheree the fields are coming from.



Brian
 
Oh well...you can't keep everyone happy Brian. :) I think the old age is getting to you!
 
Oh well...you can't keep everyone happy Brian. :) I think the old age is getting to you!
Adam, what's your excuse? brian makes a valid point that newcomers wo don't know us could find it offputting. Besides It really wasn't very funny. I know you can do better than that
 
Well I thought it was. But regardless, I will let the OP get back to the thread now. I will leave too. I apologize for the misbehavior...
 

Users who are viewing this thread

Back
Top Bottom