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

SQL query

Status
Not open for further replies.

rac55

Programmer
Jul 1, 2003
62
AU
Hi

I am trying to pull information from a database using a sql statement. I need pull where region=all...but I do not know the syntax for this. The sql is;

SELECT * FROM tblEmployee INNER JOIN
tblSignatures ON tblEmployee.MngDir = tblSignatures.MngDir
WHERE (tblEmployee.YearOfAward = '2003') AND (tblEmployee.Region = '???') OR
(tblEmployee.EmployeeNo = '') OR
(tblEmployee.Surname = '') AND (tblEmployee.FirstName = '')
ORDER BY tblEmployee.YrsOfService

Any help would be greatly appreciated
Thanks
 
Is there a specific value for the region field that indicates "all"? If not, then just leave it out, and the query will not be limited by region:

SELECT * FROM tblEmployee INNER JOIN
tblSignatures ON tblEmployee.MngDir = tblSignatures.MngDir
WHERE (tblEmployee.YearOfAward = '2003') OR
(tblEmployee.EmployeeNo = '') OR
(tblEmployee.Surname = '') AND (tblEmployee.FirstName = '')
ORDER BY tblEmployee.YrsOfService
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top