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

Would this SQL work?

Status
Not open for further replies.

RemyS

Technical User
Jul 3, 2001
100
GB
I'm using this SQL as the Row Source for a combobox in a form to select a Product, dependant on a report date, for a query parameter. But I can't tell if it's doing what I want.

SELECT DISTINCT PRODUCT, NAME FROM UNPAID_PRODS UNION SELECT DISTINCT PRODUCT, NAME FROM ARCHIVE_PRODS WHERE (((Report_Date)=[Forms]![UNPAID_ARCHIVE]![ADate])) ORDER BY PRODUCT;

I'd like to know if the WHERE clause will work on a UNION Query?


Thanks
Remy Still new to DB's and enjoying learning day by day
 
Yes, this query will work. Each SQL is processed independently and combined in a resulting dataset. R=The values in SQL 2 would be filtered by the Date petersdaniel@hotmail.com
"If A equals success, then the formula is: A=X+Y+Z. X is work. Y is play. Z is keep your mouth shut." --Albert Einstein

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top