IIf statement

C

clueless

My IIf statement is as follows:

StatusOfAppointment: IIf([ArrivalTime]<[AppointmentTime],"Early",
IIf([ArrivalTime]=[AppointmentTime],"On Time","Late))

I need to add a 15 minute window for the "On Time" (example appt 3:00, would
be on time from 3:00-3:15). Not quite sure what I need to do. Appreciate
any help.
Thanks.
 
B

Beetle

It should be something along the lines of;

StatusOfAppointment: IIf([ArrivalTime]<[AppointmentTime],"Early",
IIf(DateDiff("n",[ArrivalTime],[AppointmentTime])<=15,"On Time","Late))
 
F

fredg

My IIf statement is as follows:

StatusOfAppointment: IIf([ArrivalTime]<[AppointmentTime],"Early",
IIf([ArrivalTime]=[AppointmentTime],"On Time","Late))

I need to add a 15 minute window for the "On Time" (example appt 3:00, would
be on time from 3:00-3:15). Not quite sure what I need to do. Appreciate
any help.
Thanks.

So is that 3:00 AM or 3:00 PM?
Is it considered on time if the Arrival time for an Appointment for
3:00 PM is actually 3:10 AM the next morning? That would meet your
criteria.

You're also missing an ending quote after the word Late in your
expression.

StatusOfAppointment:IIf([ArrivalTime]<[AppointmentTime],"Early",
IIf([ArrivalTime] Between [AppointmentTime] and
DateAdd("n",15,[AppointmentTime]),"On Time","Late"))
 
K

Klatuu

Iif([ArrivalTime] < [AppointmentTime],"Early",iif([ArrivalTime] <=
dateadd("n",15,[AppointmentTime]),"On Time","Late"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help with IIf statement 2
IIf 2
IIf statement 2
Need some PWA help 0
IIf statement time 1
COMPARING TIMES AND DISPLAYING TEXT USING IF CONDITION 3
Countifs with different restrictions 1
Rounding Time 13

Top