Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why my SQL gives me wrong results
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01140687
Message ID:
01140723
Vues:
16
Did you use those table you sent once to me? If yes can you post the operator code and both periods to play with?

>Hello again BB
>
>Funny, I could have sworn I replied to your last (I certainly wrote it down)
>
>Your idea with the operator code has certainly restricted the results to one op. - great.
>That and the soln. below, though, still give wrong results.
>
>For my selected op, for the 2 time periods: curr. and prev., I should be getting 3 matching recs each.
>I'm getting the 1st record from the prev period OK, but not the other 2, and the 2nd & 3rd recs OK from the curr operiod, but not the 1st. They're excluding each other.
>
>Terry
>
>>>Hello again
>>>
>>>No, still getting the same results and still not restricting to only one operator. :-(
>>
>>Try:
>>
>>WHERE ((m.ldStartCurr BETWEEN NET.Start_date AND NET.End_date)          OR;
>>       (m.ldEndCurr   BETWEEN NET.Start_date AND NET.End_date)          OR;
>>       (NET.Start_date < m.ldStartCurr AND NET.End_date > m.ldEndCurr)  OR;
>>       (m.ldStartPrev BETWEEN NET.Start_date AND NET.End_date)          OR;
>>       (m.ldEndPrev   BETWEEN NET.Start_date AND NET.End_date)          OR;
>>       (NET.Start_date < m.ldStartPrev AND NET.End_date > m.ldEndPrev)) AND;
>>       op.Code == lnOpCode
>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform