Help in Combing 2 Queries into 1

CT Witter

MrExcel MVP
Joined
Jul 7, 2002
Messages
1,212
I was wondering if someone could help me to combine these 2 queries into 1?

First query : named qryByCat2
SELECT DISTINCT [Vendor List 1].[Account Desc], [Vendor List 1].[Vendor#]
FROM [Vendor List 1]
GROUP BY [Vendor List 1].[Account Desc], [Vendor List 1].[Vendor#];

Second Query: named qryByCat3
SELECT qryByCat2.[Account Desc], Count(qryByCat2.[Vendor#]) AS [CountOfVendor#]
FROM qryByCat2
GROUP BY qryByCat2.[Account Desc];

Do I need to union? Thanks!
CT
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Why not link them by Vendor#?

What result are you trying to get?
 
Upvote 0

Forum statistics

Threads
1,221,704
Messages
6,161,390
Members
451,701
Latest member
ckrings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top