SQL SELECT Query

jsdba

Registered User.
Local time
Today, 13:34
Joined
Jun 25, 2014
Messages
165
Need some help with a SELECT query.

I have a table
Code:
Table
-------
ID
TypeID[Foreign Key]
Selected [checkbox]
LumpSum [checkbox]

I want to select the following records:

1. - Selected = True
2. - TypeID = 1 or 2
+
3. - If TypeID = 3, 4, 5 then LumpSum = True

The recordset i want is a combination of 2 and 3. Keep in mind that 1 is assumed for both recordsets

Thanks
 
How about

SELECT *
FROM TableName
WHERE Selected = True AND (TypeID IN(1, 2) OR (TypeID IN(3, 4, 5) AND LumpSum = True))
 
Thank you sir
 

Users who are viewing this thread

Back
Top Bottom