Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why my SQL gives me wrong results
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01140687
Message ID:
01140723
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform