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!

conditional select

Status
Not open for further replies.

jcf27

IS-IT--Management
Aug 24, 2002
21
0
0
US
I need help in building a conditional select (nested?) based on different cells values.

For example:

Table A

Item Date Description
123 12/31/02 small widget
345 12/31/02 small widget
333 12/31/02 big widget
444 10/10/03 small widget
555 10/11/03 big widget
666 02/02/03 big widget

I need to select all small widgets, but only big widgets with dates greater than 5/5/03.

Can it be done in one single select?

Thanks!

J.
 
SELECT * FROM A
WHERE Description = 'Small widget'
OR (Description = 'Big Widget' AND Date > '05/05/03'

Not sure.. but i think this should work well..
 
SELECT * FROM A
WHERE Description = 'Small widget'
OR (Description = 'Big Widget' AND Date > '05/05/03')

Not sure.. but i think this should work well..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top