If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Iif statement and time format
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") -- TDC |
#2
|
|||
|
|||
Iif statement and time format
hi,
On 09.03.2010 20:36, TDC wrote: 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 -- |
#3
|
|||
|
|||
Iif statement and time format
TDC wrote:
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") -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|