If statement Query

  • Thread starter Thread starter jacqueline
  • Start date Start date
J

jacqueline

Where and how do I write an if statement in a query.
I have a table called incent where I am pulling the data.

Two fields to be compared.

ActualHrs Set hRS Varience tbd
245 400 155 1


IF varience field 35< then "1" in the TBD field.

Thanks.
 
Query in Access, they used "iif" instead of "if".
This is what it will look like.

Select ActualHrs, [Set hRS], Varience,
iif(incent.Varience < 35, 1, 0) as tdb
from incent;

This will give you a 1 if varience is less than 35, 0
otherwise.
 
Back
Top