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:
01005794
Views:
18
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform