IIf statement range problem

Sasoriza28

Registered User.
Local time
Today, 03:53
Joined
Aug 13, 2012
Messages
13
I have this statement in the control source of a text box
=IIf([room] Between 100 And 220,"9AM","10AM")

Which is basically what I want to do but I didn't think about the fact that some rooms are 101a and 101b. How can I rewrite this to work with these rooms? Is there a way to write it so 9AM shows up for rooms containing "100-220" and ignore the A and B?
 
So you need to test against the numeric part of the rooms and I believe all your room names begin with numbers. For this you will use the Val() function
Code:
=IIF(Val([Room]) >= 100 and Val([Room]) <= 220, "9AM", "10AM")
 
Perfect! Thanks
 

Users who are viewing this thread

Back
Top Bottom