Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why my SQL gives me wrong results
Message
De
27/07/2006 11:44:24
 
 
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:
01140731
Vues:
14
But there are 6 records that meet my supplied criteria, i.e. 3 each for the 2 date periods, and for a particular operator. So surely I should get 6 records in the results, as each falls under one of the OR clauses?

This is very similar to the last one you helped me with, but in that case we were sifting single-date records where the date fell BETWEEN either of the date ranges. I then joined them to get them side-by-side, for the report.

>If records in NET belongs to both periods, it'll show only once. Create separate queries for current period and previous period and UNION ALL them.

>
>>
>>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.
>>
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform