Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL changed its mind again
Message
From
28/07/2006 16:50:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxExpress
Title:
SQL changed its mind again
Miscellaneous
Thread ID:
01141384
Message ID:
01141384
Views:
53
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 
- 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.
Next
Reply
Map
View

Click here to load this message in the networking platform