General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only