Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: View
Miscellaneous
Thread ID:
01165282
Message ID:
01165358
Views:
18
>Hello Borislav,
>
>
> CREATE CURSOR Employee ( Iid I  )
>  CREATE CURSOR Contrat_l ( Iid I  , iemployeeiD I , ddebut D(8) , dfin D(8) )
>
>  FOR x = 1 TO 60
>    INSERT INTO Employee VALUES (x)
>  ENDFOR
>
>  m.lDCurrentDate = DATE()
>
>  INSERT INTO Contrat_l VALUES ( 1 , 4 , {^2005/03/18}, {^2005/09/15} )
>  INSERT INTO Contrat_l VALUES ( 2 , 14 , {^2001/06/13}, {^2006/01/12} )
>  INSERT INTO Contrat_l VALUES ( 3 , 14 , {^2007/01/12}, {} )
>  INSERT INTO Contrat_l VALUES ( 4 , 22 , {^2003/01/12},  {^2003/09/12} )
>
>
>
>  SELECT *;
>    FROM Employee;
>    LEFT JOIN Contrat_l ON Employee.Iid = Contrat_l.iemployeeiD ;
>    WHERE IIF( ISNULL( Contrat_l.Iid ) = .F. , ;
>    IIF( BETWEEN(  m.lDCurrentDate , Contrat_l.ddebut , Contrat_l.dfin ) OR  EMPTY(Contrat_l.dfin ), .T. , .F. ) ,;
>    .T. )
>
>
>Give me a beginning of result ...
>
>What are you thinkin about ?
>
>
>bernhart
>
>
>
CREATE CURSOR Employee ( Iid I  )
  CREATE CURSOR Contrat_l ( Iid I  , iemployeeiD I , ddebut D(8) , dfin D(8) )

  FOR x = 1 TO 60
    INSERT INTO Employee VALUES (x)
  ENDFOR

  m.lDCurrentDate = DATE()

  INSERT INTO Contrat_l VALUES ( 1 , 4 , {^2005/03/18}, {^2005/09/15} )
  INSERT INTO Contrat_l VALUES ( 2 , 14 , {^2001/06/13}, {^2006/01/12} )
  INSERT INTO Contrat_l VALUES ( 3 , 14 , {^2007/01/12}, {} )
  INSERT INTO Contrat_l VALUES ( 4 , 22 , {^2003/01/12},  {^2003/09/12} )



  SELECT *;
    FROM Employee;
    LEFT JOIN Contrat_l ON Employee.Iid = Contrat_l.iemployeeiD ;
    WHERE (ISNULL( Contrat_l.Iid ) OR ;
           (BETWEEN(  m.lDCurrentDate , Contrat_l.ddebut , Contrat_l.dfin ) OR  EMPTY(Contrat_l.dfin )))
Yes this query gives you the same result. (I can't remember what were my thoughts when I reply yesterday)
BTW why you always compare logical expressions with .t. or .f.? There is no need of it.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform