Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL changed its mind again
Message
From
28/07/2006 21:17:55
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxExpress
Miscellaneous
Thread ID:
01141384
Message ID:
01141425
Views:
19
Hi,
I see that you are using == check your set ansi & set exact settings.

>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
>
>
Regards N Mc Donald
Previous
Reply
Map
View

Click here to load this message in the networking platform