Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About sql syntax (URGENT)
Message
De
22/01/2001 21:07:24
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00467002
Message ID:
00467087
Vues:
17
>Thanks for the help,
>
>would you like to re-write the sql syntax without "[]" character and
>write pls syntax for other fields like sex field

Kosta,

You need to check each field to see if it's equal to "All". If it is, don't include it in the SQL statement, if not, ask for fields that match.
cSQLStatement = ;
  [SELECT * FROM okul2 ] + ;
  [WHERE ] + ; 
  IIF(thisform.Combo1.value = "All", [.T. ], ;
  IIF(thisform.Combo1.value = "Male", [okul2.sex = "M" ], ;  
  [okul2.sex = "F" ])) + ; 
  IIF(thisform.Combo2.value <> "All", ;
  [and okul2.ilce=thisform.Combo2.value ], []) + ;  
  IIF(thisform.Combo3.value <> "All", ;
  [and okul2.okul=thisform.Combo3.value ], []) + ;  
  IIF(thisform.Combo4.value <> "All", ;  
  [and okul2.ozur=thisform.Combo4.value ], []) + ;  
  IIF(thisform.Combo5.value <> "All", ;  
  [and okul2.zeka=thisform.Combo5.value ], []) + ;  
  IIF(thisform.Combo6.value <> "All", ;  
  [and okul2.onlem=thisform.Combo6.value ], []) + ;  
  IIF(thisform.Combo7.value <> "All", ;  
  [and okul2.devam=thisform.Combo7.value ], []) + ;  
  [and okul2.iq>=thisform.Text1.value ] + ;  
  [and okul2.iq<=thisform.Text2.value ] + ;
  [into cursor crsResult NOFILTER ]

&cSQLStatement

browse
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform