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

Query and Arrays 1

Status
Not open for further replies.

Spyrios

Technical User
Jan 24, 2004
22
US
Can I use an array in an Access query? I have a query right now that works, but it's growing way to large and it won't be easily managed the way I have it. This is what I have:

Basic: (select count(SalesType) from LocalSales where SalesType = 1 OR SalesType = 101 OR SalesType = 201) etc. etc.

That works, but I have so many options there it could get messy. What I want to do is something like this:

Basic:(SELECT COUNT(SalesType) FROM LocalSales WHERE SalesType = (1,101,201))

Any ideas?
 
Use IN as in IN (1,101,201). The contents of the IN can of course be another select.

 
AWESOME. Thanks, you just saved me a ton of trouble! If I could give 2 stars I would!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top