Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL changed its mind again
Message
From
29/07/2006 09:45:50
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxExpress
Miscellaneous
Thread ID:
01141384
Message ID:
01141485
Views:
26
The ETMDATA SQL gets just the selected operator OK. It's this code following later, that selects the non-ETM data (from table NOTETM) that gets the spurious operator data. Now some operators can have records in both tables so I do need to check both. Can you see where this goes wrong? I've made the same change:

AND NET.Operator == lnOpCode;

on the Where clause as I did with th ETM data (Or it was already like that - I do have 8 SQLs to maintain - I'm only posting one simpler one, in the hope that solving that will solve the others)

The most annoying thing about programming is that the change of one simple line can save HOURS of hair pulling.

Any ideas? I'm getting so desperate now.

>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.
SELECT NET.Operator, NET.Route, NET.Start_Date, NET.End_Date, NET.RorF, NET.Passengers, ;
  IIF( NET.Route == NET.Mcl_Rte, "    ", NET.Mcl_Rte) as ContrNum, ;
  0000000 AS CurrPass, 0000000 AS PrevPass, op.Desc as OpDesc, RF1.ServType ;	
  FROM NotETM NET ;
    JOIN Operator op ;
      On NET.Operator == op.Code ;
    JOIN RF1 ;
      On  NET.Operator == RF1.Operator ;
      and NET.Route    == RF1.ERoute ;
    WHERE (( m.ldStartCurr BETWEEN NET.Start_date AND NET.End_date) ;
  	OR ( m.ldEndCurr   BETWEEN NET.Start_date AND NET.End_date) ;
  	OR ( NET.Start_date < m.ldStartCurr AND NET.End_date > m.ldEndCurr) ;
  	OR ( NET.Start_date => m.ldStartCurr AND NET.End_date <= m.ldEndCurr) ; 		  
  	OR ( m.ldStartPrev BETWEEN NET.Start_date AND NET.End_date) ;
  	OR ( m.ldEndPrev   BETWEEN NET.Start_date AND NET.End_date) ;
  	OR ( NET.Start_date < m.ldStartPrev AND NET.End_date > m.ldEndPrev)) ; 
  	OR ( NET.Start_date => m.ldStartPrev AND NET.End_date <= m.ldEndPrev) ;
    AND   NET.Operator == lnOpCode;
  ORDER BY    NET.Operator, NET.Route ;
INTO CURSOR csrNotETMPassengers 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
Next
Reply
Map
View

Click here to load this message in the networking platform