question

TelepathicSheep2 avatar image
TelepathicSheep2 asked

Select Statement, Where clause help - need to select active projects & closed projects from this year

I have a very simple question (I think): I know how to do this using two queries: Select * from TABLE WHERE PROJECT_STATUS LIKE 'ACTIVE'; and... Select * from TABLE WHERE PROJECT_STATUS LIKE 'CLOSED' AND COMPLETION-DATE > '2011-01-01'; but, I'd like to do this in one query, how would I do that? Any suggestions would be appreciated. Thanks
selectwhere
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ThomasRushton avatar image
ThomasRushton answered
So, what you want is to select Active projects `OR` projects that are closed with a completion date after 2011-01-01: SELECT * FROM TABLE WHERE (PROJECT_STATUS LIKE 'ACTIVE') OR ( (PROJECT_STATUS LIKE 'CLOSED') AND (COMPLETION-DATE > '2011-01-01') )
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TelepathicSheep2 avatar image TelepathicSheep2 commented ·
Great - that was real easy, thanks for your help!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.