Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Union
Message
From
06/05/2002 14:05:44
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
06/05/2002 13:59:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Union
Miscellaneous
Thread ID:
00653170
Message ID:
00653176
Views:
26
Try UNION ALL

>I'm trying to basically count data from 2 tables. I'm using a UNION command as such.
>
>sele cellcode,sum(IIF(betw(fdisp,"01","05"),1,0)) as sales,;
>sum(IIF(fdisp="01") as contacts,;
>sum(IIF(fdisp="01") as bad,;
>from table1;
>where curdate<="020505";
>group by cellcode;
>UNION;
>sele cellcode,sum(IIF(betw(fdisp,"01","05"),1,0)) as sales,;
>sum(IIF(fdisp="01") as contacts,;
>sum(IIF(fdisp="01") as bad,;
>from table2;
>where curdate<="020505";
>group by cellcode;
>
>Both tables are identical The problem is - I get duplicate cellcodes one below the other. Instead, I need the result summed up for both tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform