If statement Query

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.
 
J

JL

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.
 

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

Top