Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Sql
Divers
Thread ID:
00339044
Message ID:
00339127
Vues:
16
>Hi Mark:
> I got your message. I updated the sql statement but I got the same result. Any other options I can try? Thank you.
>
>select f_name,l_name, ext, DEPT, ;
>sum(iif(cdow(start)== "Monday",LENGTH,0)) AS MON,;
>sum(iif(cdow(start+1)== "Tuesday",LENGTH,0)) AS TUES, ;
>sum(iif(cdow(start+2)== "Wednesday",LENGTH,0)) AS WED,;
>sum(iif(cdow(start+3)== "Thursday",LENGTH,0)) AS THU, ;
>sum(iif(cdow(start+4)== "Friday",LENGTH,0)) AS FRI ;
>FROM STAFF, CALL_DET ;
>WHERE EXT == CALL_STN AND ;
>upper(alltrim(ACTION)) == "INCOMING CALL" and ;
>between(calldate,{01/10/2000},{01/14/2000}) ;
>GROUP BY EXT,dept into cursor temp
>
>sherry

How are you joining the 2 tables? I do not see a where staff.keyid = call_det.staff_id

Group by all non-summed fields. You m ay need to experiment with the order the fields are listed in this clause to get the desired results. My guess is you need it like the following --

Group By dept, f_name, l_name, ext

You may even try the relative number in the selection list --

Group By 4, 1, 2, 3
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform