Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL changed its mind again
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxExpress
Divers
Thread ID:
01141384
Message ID:
01141477
Vues:
16
Hey Boris

That was a breakthrough. I still get other operators, but at least the report STARTS with the selected op. I wonder if it's the NOTETM data that follows that's screwing it. But I DID apply similar to all the SQLs.

Terry

>>The following code was happily and successfully selecting data for just the chosen operator, now its gone back to selecting all operators (or damn near all). I don't know what I've done to make it change its mind.
>>
>>Any ideas?
>>
>>
>>SELECT ET.Operator, ET.Route, ET.Class, ET.Date, ET.RorF, op.Desc as OpDesc, RF1.ServType, ;
>>  IIF( ET.Route == ET.Mcl_Rte, "    ", ET.Mcl_Rte) as ContrNum, ;
>>  SUM( IIF( BETWEEN( ET.date, ldStartCurr, ldEndCurr), ET.Number, 0000000)) AS CurrPass, ;
>>  SUM( IIF( BETWEEN( ET.date, ldStartPrev, ldEndPrev), ET.Number, 0000000)) AS PrevPass ;
>>  FROM ETMData ET ;
>>    JOIN Operator op ;
>>	On ET.Operator  == op.Code ;
>>    JOIN RF1 ;
>>	On  ET.Operator == RF1.Operator ;
>>	and ET.Route    == RF1.ERoute ;
>>  WHERE op.Code	       == lnOpCode ;
>>  And	(   ET.date BETWEEN ldStartCurr and ldEndCurr ;
>>  	 OR ET.date BETWEEN ldStartPrev and ldEndPrev) ;
>>  GROUP BY ET.Mcl_Rte, ET.Operator, ET.Route, ET.Class ;
>>  ORDER BY ET.Operator, ET.Route, ET.Class ;
>>  INTO CURSOR csrETMPassengers NOFILTER
>>
>>
>
>Terry,
>what happoens if you change:
> WHERE op.Code == lnOpCode ;
>
>To
> WHERE ET.Operator == lnOpCode ;
- 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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform