Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Union
Message
From
06/05/2002 14:07:43
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
06/05/2002 14:05:44
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Union
Miscellaneous
Thread ID:
00653170
Message ID:
00653179
Views:
25
OOPS My mistake. All should give you duplicate. Sorry.
>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
Reply
Map
View

Click here to load this message in the networking platform