If Statement Date Statement Subtract Statement Join 2 Tables Join 3 Tables Back
Logo image

If Statement

Suppose you have a table like below & you like to check for anything lesser than $9000 to be indicated as within budget. You can use the IIf( Val() ) statement.


Output Wanted:

SQL will be:

Select IfTable.Model, IfTable.Sales, IIf( Val(Sales < 9000), "Within Budget", "Out of Budget")
AS [Match?] From IfTable
Where IfTable.Model LIKE '*'
Order By IfTable.Sales DESC;