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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHERE statement

Status
Not open for further replies.

MrMystery

Technical User
Apr 24, 2002
39
GB
Is it possible to build a condition into an SQL where statement to perform a different selection dependant on the value of a selection parameter?
e.g.
Selection Parameter = JobNo
Value can be either a job number or 'ALL'

If I enter a job number, then my 'WHERE' statement must only select values from the table matching this job number, EXCLUDING NULL values.
If I enter 'ALL' then my 'WHERE' statement must select ALL records, including NULL values.

Any help appreciated!

Mike
 
Have a look at this thread to start you off:

thread183-508649 --James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top