Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Union
Message
De
06/05/2002 13:59:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Union
Divers
Thread ID:
00653170
Message ID:
00653170
Vues:
65
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform