tsteele2000
MIS
I'm writing a query and I want to write an expression that looks at a time field, and if that time falls within a certain period, returns a value.
Something along the lines of:
if(8:59:00 AM>[TimeIn]>11:00:00 AM),1,ELSEIF(10:59:00 AM>[TimeIn]>1:00:00 PM,2,ELSEIF(12:59:00 PM>[TimeIn]>3:00:00 PM,3,ELSEIF(2:59:00 PM>[TimeIn]>6:00:00 PM,4))))
So if the time is between 9 - 11, returns a value of 1
If the time is between 11 - 1, returns a value of 2, etc.
What is the syntax for creating a field based on this expression, in Access?
Thanks.
Something along the lines of:
if(8:59:00 AM>[TimeIn]>11:00:00 AM),1,ELSEIF(10:59:00 AM>[TimeIn]>1:00:00 PM,2,ELSEIF(12:59:00 PM>[TimeIn]>3:00:00 PM,3,ELSEIF(2:59:00 PM>[TimeIn]>6:00:00 PM,4))))
So if the time is between 9 - 11, returns a value of 1
If the time is between 11 - 1, returns a value of 2, etc.
What is the syntax for creating a field based on this expression, in Access?
Thanks.