Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use "IF" in sql query

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
0
0
US
Folks,

I have the following query that runs on an Access table:

SELECT IIF([Invoice Master].STYPE_31 = 'CU', 1, -1)*[Invoice Detail].INVQTY_32 AS totalSales
FROM [Invoice Master] INNER JOIN [Invoice Detail] ON [Invoice Master].INVCE_31 = [Invoice Detail].INVCE_32

How to I translate the IIF section of this query so that it will work on a Pervasive SQL table with the same structure?

Mighty
 
Made some stupid errors in the query. Just replaced the IIF with IF and it seems to work fine - does that make sense??

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top