Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
About sql syntax (URGENT)
Message
From
22/01/2001 21:07:24
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00467002
Message ID:
00467087
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform