Combine simple query results.

Carrie

Active Member
Joined
Nov 20, 2002
Messages
418
This is the query I have so far.

SELECT [Tbl - TS Created SR's].[Created Day], [Tbl - TS Created SR's].[Functional Sub Area], [Tbl - TS Created SR's].Queue, Count([Tbl - TS Created SR's].[SR #]) AS [Software Update Count]
FROM [Tbl - TS Created SR's]
GROUP BY [Tbl - TS Created SR's].[Created Day], [Tbl - TS Created SR's].[Functional Sub Area], [Tbl - TS Created SR's].Queue
HAVING ((([Tbl - TS Created SR's].[Created Day])>=[Start Date] And ([Tbl - TS Created SR's].[Created Day])<=[End Date]) AND (([Tbl - TS Created SR's].[Functional Sub Area]) Like "Health Network" Or ([Tbl - TS Created SR's].[Functional Sub Area]) Like "MENDS") AND (([Tbl - TS Created SR's].Queue) Like "Software Updates" Or ([Tbl - TS Created SR's].Queue) Like "Software Update"));


When it reports I get two records of data. One for MENDS and one for Health Network and because Software update goes with MENDS and Software updates goes with Health Network.

I want to combine the totals. So if there were 6 in one and 7 in the other I would get one total that says Software update is 13.

Is this possible?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi Carrie

I think it is the "Group By's" that is causing the problem.

Try pasting this SQL into a new query and see if it returns what you want :

SELECT Count([Tbl - TS Created SR's].[SR #]) AS [Software Update Count]
FROM [Tbl - TS Created SR's]
WHERE ((([Tbl - TS Created SR's].[Created Day])>=[Start Date] And ([Tbl - TS Created SR's].[Created Day])<=[End Date]) AND (([Tbl - TS Created SR's].[Functional Sub Area]) ="Health Network" Or ([Tbl - TS Created SR's].[Functional Sub Area])="MENDS") AND (([Tbl - TS Created SR's].Queue) Like "Software Update*"));

HTH, Andrew :)
 
Upvote 0

Forum statistics

Threads
1,221,854
Messages
6,162,452
Members
451,765
Latest member
craigvan888

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