View Full Version : Merge Two Queries Into One


rfear
02-09-2009, 01:47 AM
I want to merge two queries into one ( see attachment ).

I've unioned queries before but only when one field has matched. This problem needs to match 2 fields.

Basically I want all the fields in NEWQRY_SUMRATES but only the fields Resource Whole and Availability from NEWQRY_DAYSBOOKED where Yr and Wk in NEWQRY_DAYSBOOKED match Yr and Wk in NEWQRY_SUMRATES.

Rich.

Rabbie
02-09-2009, 03:35 AM
Use the Query design grid to build what you want. Just click on the links between the fields to select all records from NEWQRY_SUMRATES and only records where there is a match from NEWQRY_DAYSBOOKED.

This should create an OUTER(Either LEFT or RIGHT)join between the tables when you look at the SQL source for the query.

rfear
02-09-2009, 04:54 AM
Cool, worked a treat. Thanks.

Rabbie
02-09-2009, 04:57 AM
Glad to have been of help