Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by clause
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01005559
Message ID:
01005807
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
Try
*    COUNT(P2.iid) + COUNT(P1.iid) total,;

SUM( IIF( NOT ISNULL(P1.iid), 1, 0) + ;
		IIF( NOT ISNULL(P2.iid) AND ISNULL(P1.iid), 1, 0)) AS total,;
> SELECT ;
>    H.iemployeeid,;
>    COUNT(P1.iid) totaljop1,;
>    COUNT(P2.iid) totaljop2,;
>    COUNT(P2.iid) + COUNT(P1.iid) total,;
>    MAX( PADR( NVL( F.cnom , '' ), 20 ) ) cnomf,;
>    MAX( F.Nordre ) nOrdreF,;
>    MAX( E.cnosecretariat ) cnosecret,;
>    MAX( E.cparaphe ) cparaphe,;
>    MAX( E.iFonctionId ) iFoncId,;
>    MAX( E.nextrapolhoraire ) nextrAss ,;
>    MAX( E.nextrapolhoraire_n ) nextrNass ,;
>    SUM( IIF( E.Lassimilinami = .F. OR P1.Iassimilid = .F. , 
H.n100 + H.n100_2 + H.n120 + H.n120_2 , 0.00 )) totHoNAs ,;
>    SUM( IIF( E.Lassimilinami = .T. AND P1.Iassimilid = .T. , 
H.n100 + H.n100_2 + H.n120 + H.n120_2 , 0.00 )) totHoAs ;
>    FROM Horaire H;
>    LEFT JOIN PAUSE P1 ON P1.iid = H.cpauseid;
>    LEFT JOIN PAUSE P2 ON P2.iid = H.cpauseid2;
>    INNER JOIN Employee E ON  E.iid = H.iemployeeid;
>    LEFT OUTER JOIN Fonction F ON  F.iid = E.iFonctionId;
>   WHERE  H.ddate BETWEEN m.D_debut  AND m.d_fin AND;
>    NOT ( H.cpauseid = 0 AND H.cpauseid2 = 0 );
>    GROUP BY 1 ;
>    INTO CURSOR Temp2
>I should like for that employee 24 Days but the query give me 25 days ( query.total )
>because the 8 april er is 2 pauses.
>
>24 days is the good result ....
>
>bernhart
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform