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

Search Query 1

Status
Not open for further replies.

Buj123

Programmer
Jan 5, 2004
96
US
Hello,
I have a small question. I need to qritea query that searches for a DeptNo from 10 fileds. I am not sure how to specify for 10 fields.

SELECT tblSubmissionForm.*
FROM tblSubmissionForm
where Dept1=[EnterDepartment];

In this above query it asks the user to specify the DeptNo and Searches in only Dept1 Filed but what i need is when the user specifies a DeptNo then it should search for that DeptNo in Dept1, Dept2,Dept3,Dept4.....Dept10. How to write a query to do that?
 
sounds like this database violates form
none the less use or

SELECT tblSubmissionForm.*
FROM tblSubmissionForm
where Dept1=[EnterDepartment] or where Dept=[EnterDepartment] or where Dept3=[EnterDepartment] etc...;
 
SELECT tblSubmissionForm.*
FROM tblSubmissionForm
WHERE Dept1=[EnterDepartment] or Dept2=[EnterDepartment] or Dept3=[EnterDepartment] or Dept4=[EnterDepartment];

This one worked out for me. Thanks. Star for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top