Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Too many args in my complex SQL
Message
From
30/08/2007 12:38:35
 
 
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:
01251397
Message ID:
01251420
Views:
15
Thanks a lot Rick. But I went just as gozzy trying to "spot the difference" in your code and mine. :-) Boris highlighted it - the same as yours.

...
>
>You are missing a ) in one of the IIF's. Try:
>
>SELECT ET.Operator, ET.Route, ET.Class, ET.Date, ET.RorF, op.Desc as OpDesc, ;
>       Thisform.lmGetServeType( ET.Operator, ET.Route, ET.Date) as ServeType, ;
>       IIF( ET.Route == ET.Mcl_Rte, "    ", ET.Mcl_Rte) as ContrNum, ET.Family, ;
>       SUM( IIF( BETWEEN( ET.date, ;
>	                 IIF( not EMPTY( ldStartCurr), ;
>		             ldStartCurr, ;
>	                      ldEndPrev), ;
>	                 ldEndCurr), ;
>	        ET.Number, ;
>	        0000000) ) AS CurrPass, ;
>       SUM( IIF( BETWEEN( ET.date, ;
>		        ldStartPrev, ;
>		        IIF( not EMPTY( ldEndPrev), ;
>			    ldEndPrev, ;
>			    ldStartCurr)), ;
>	        ET.Number, ;
>	        0000000) ) AS PrevPass ;
>  FROM ETMData ET ;
>	JOIN Operator op ;
>	On   ET.Operator 	== op.Code ;
>  WHERE ET.Operator 	== lnOpCode ;
>  AND	(    ET.date BETWEEN ldStartCurr and ldEndCurr ;
>  	  OR ET.date BETWEEN ldStartPrev and ldEndPrev) ;
>  AND not DELETED() ;
>  ORDER BY ET.Operator, OpDesc, ET.Route, ET.Class ;
>  GROUP BY ET.Mcl_Rte, OpDesc, ET.Operator, ET.Route, ET.Class ;
>  INTO CURSOR csrETMPassengers NOFILTER READWRITE
>
- 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.
Previous
Reply
Map
View

Click here to load this message in the networking platform