iif statement datediff help

tubar

Registered User.
Local time
Today, 16:31
Joined
Jul 13, 2006
Messages
190
I have a general date column titled “in” I use a query to convert it to short time.
Inhr: Format([in],"Short Time")

I then calculate the hours between midnight and 6am using this
1: IIf([inhr] between #00:00:00# and #06:00:00#,DateDiff("h",[inhr],#06:00:00#),0)

It works like a champ, except when the "in" time is 00:00:00…any suggestions?
 
Also it is best to avoid "in" as a field name because in is a keyword in SQL and hence reserved.
 

Users who are viewing this thread

Back
Top Bottom