Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Or in an IIF Statement not working

Status
Not open for further replies.

r0nniem

Technical User
Dec 22, 2005
28
AU
this is my code that's not working:

iif(Weekday([answered_time])=1 or 7, "Weekend", IIf(TimeValue([answered_time])<"16:00","Day","Evening")

It will work if I use:
iif(Weekday([answered_time])=1, "Weekend", IIf(TimeValue([answered_time])<"16:00","Day","Evening")
and:
iif(Weekday([answered_time])=7, "Weekend", IIf(TimeValue([answered_time])<"16:00","Day","Evening".

Can you please help?

Thanks in advance :)
 
iif(Weekday([answered_time])=1 or Weekday([answered_time])=7, "Weekend", IIf(TimeValue([answered_time])<"16:00","Day","Evening")


Or

iif(Weekday([answered_time]) Mod 6 =1, "Weekend", IIf(TimeValue([answered_time])<"16:00","Day","Evening")


[pc2]
 
another way:
IIf(Weekday([answered_time]) In (1,7), 'Weekend', IIf(TimeValue([answered_time])<#16:00#,'Day','Evening'))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top