Re: Sum a Union Query

From: news.microsoft.com (noidea_at_nospam.com)
Date: 10/25/04


Date: Mon, 25 Oct 2004 14:19:58 +0100

Thanks this is just what I was looking for
"Hugo Kornelis" <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message
news:0t3on0t4us3dhm7s1is584umrbrccfqc98@4ax.com...
> On Sun, 24 Oct 2004 16:37:14 +0100, Newbie wrote:
>
> >What I want to know is how to do the sum part on a union query?
>
> Hi,
>
> The genral format is something like this:
>
> SELECT xxx, yyy, SUM(zzz), SUM(qqq)
> FROM (SELECT xxx, yyy, zzz, qqq
> FROM ....
> WHERE ....
> UNION [ALL]
> SELECT xxx, yyy, zzz, qqq
> FROM ....
> WHERE ....) AS d(xxx, yyy, zzz, qqq)
> GROUP BY xxx, yyy
>
> If you need more specific help, re-read my previous message indicating
> what information you should post to enable me to help you.
>
> Best, Hugo
> --
>
> (Remove _NO_ and _SPAM_ to get my e-mail address)



Relevant Pages

  • Re: union query precision issue
    ... (SUM ... If It works if I remove above union query from my union query. ... If it is are there any workaround? ... May I have SUM function in the union query to keep the decimal precisions? ...
    (microsoft.public.access.queries)
  • Re: union query precision issue
    ... "John Spencer" wrote: ... (SUM ... argument of the IIF expression. ... If It works if I remove above union query from my union query. ...
    (microsoft.public.access.queries)
  • Re: Another Union query question
    ... The three rows should alll be labeled Sum of PT or something to indicate ... "Jeff Boyce" wrote: ... > end up with a report that shows: ... > To get this, one approach would be to use a UNION query, where the ...
    (microsoft.public.access.queries)