Link to home
Create AccountLog in
Avatar of ozgirl
ozgirl

asked on

help with Time Diff in Query

Hi

i have a formula in a query but need to take 60 minutes of the time.

Status: IIf([end]<=[Local]-60,"Warning","")

end is a time ie 12:00
Local is the local time ie 14:00
so if the local time is 13:00 then the column changes to Warning as its an hour out
however i cant get this query to work

thanks for your help
ozgirl
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image



Status: IIf(DateDiff("n", [end], [Local]) >60,"Warning","")

mx
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
loops

DateDiff("n",[mZipPost],[mxPost])> 1   :-)

mx
Lol!  :)
I meant ... 'oops', not 'loops'

oz ... please split the points here with mZip.

mx
Avatar of ozgirl
ozgirl

ASKER

thanks very much.. i get it now :)
ozgirl,

Did you try mx's  post?
See if I offer to split again, lol !

mx
Ahh... I think I get it.  [End] and [local] are backwards in the datediff.   (result -60 instead of 60)
ahh ... let me correct THAT:

Status: IIf(ABS(DateDiff("n", [end], [Local])) >60,"Warning","")

mx