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!

Combine queries

Status
Not open for further replies.

evergrean100

Technical User
Dec 1, 2006
115
US
How can I combine the two below queries in Access 2003 where I need to know if none, one or both of the queries got a hit from form entries taken from a Web page:

Code:
select * from mytable
where firstname = 'formvariable.pocfirstname'
and lastname = 'formvariable.poclastname';

Code:
select * from mytable
where firstname = 'formvariable.supfirstname'
and lastname = 'formvariable.suplastname';

 
You should be able to use something like this.
Code:
select Count(*) as NumOf 
from mytable
where (firstname = 'formvariable.pocfirstname'
and lastname = 'formvariable.poclastname') Or
(firstname = 'formvariable.supfirstname'
and lastname = 'formvariable.suplastname');

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top