Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by clause
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01005559
Message ID:
01005794
Vues:
17
Nice picture but it doesn't expalin what's wrong with query. Can you describe what conditions you want to apply to this query?
BTW, where H.cpauseid1 came from? I don't see it in your query?

>
>www.lesbouleaux.com\UT1.jpg
>
>I should like 24 day of work ......
>But it give me 25 jours ( days )
>
>bernhart
>
>>The WHERE clause I posted is equivalent of the WHERE clause from your query. What result do you want/expect?
>>
>>>But it give me a bad result...
>>>
>>>If H.cpauseid <> 0 AND H.cpauseid2 <> 0 =========> 1 Day
>>>If H.cpauseid <> 0 AND H.cpauseid2 = 0 =========> 1 Day
>>>If H.cpauseid2 <> 0 AND H.cpauseid1 = 0 =========> 1 Day
>>>If H.cpauseid2 = 0 AND H.cpauseid1 <> 0 =========> 1 Day
>>>If H.cpauseid2 =0 AND H.cpauseid1 = 0 =========> 0 Day
>>>
>>>
>>>bernhart
>>>
>>>
>>>
>>>
>>>>Try
    WHERE H.ddate BETWEEN m.D_debut  AND m.d_fin ;
>>>>      AND NOT ( H.cpauseid = 0 AND H.cpauseid2 = 0 )
>>>>* or
>>>>    WHERE H.ddate BETWEEN m.D_debut  AND m.d_fin ;
>>>>      AND ( H.cpauseid <> 0 OR H.cpauseid2 <> 0 )
>>>>
>>>>
>>>>
>>>>>Fabio,
>>>>>
>>>>>a big thank !!!!
>>>>>
>>>>>This query give goods results but it is possible to optimize the whereClaus ?
>>>>>
>>>>>bernhart
>>>>>
>>>>>
>>...
>>>>>    WHERE H.ddate BETWEEN m.D_debut  AND m.d_fin AND;
>>>>>    ( ( H.cpauseid <> 0 AND H.cpauseid2 <> 0 ) OR ;
>>>>>    ( H.cpauseid2 <> 0 AND H.cpauseid = 0 ) OR;
>>>>>    ( H.cpauseid2 = 0 AND H.cpauseid <> 0 ) );
>>>>>    GROUP BY 1 ;
>>>>>    INTO CURSOR Temp2
>>>>>
>>>>>
>>>>>
>>>>>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform