Iif statement and time format

  • Thread starter Thread starter TDC
  • Start date Start date
T

TDC

I have a table with a time field that displays a long form time (12:00:00 AM)
by default. Through a query I want to build a work shift field for grouping
these records. Below is an expression, but I know the time format is wrong.
What format do I use?

iif(([AccTime]between 6:01 and 18:00), "Day", "Night")
 
hi,

What format do I use?

iif(([AccTime]between 6:01 and 18:00), "Day", "Night")

IIf(
TimeValue([AccTime]) >= #06:01#
AND TimeValue([AccTime]) <= #18:00#,
"Day",
"Night")


mfG
--> stefan <--
 
TDC said:
I have a table with a time field that displays a long form time (12:00:00 AM)
by default. Through a query I want to build a work shift field for grouping
these records. Below is an expression, but I know the time format is wrong.
What format do I use?

iif(([AccTime]between 6:01 and 18:00), "Day", "Night")


First, date/time values are stored as a Double, the format
is irrelevant to the question. The format is just a guide
on how it should be displayed.

When you want to use a date/time constant, you need to
enclose it in # signs.

IIf(AccTime Between #6:01# And #18:00#, "Day", "Night")
 
Back
Top