Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using checkbox values with SQL where clause
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Using checkbox values with SQL where clause
Divers
Thread ID:
00794379
Message ID:
00794379
Vues:
36
Hi All,
i have a SQL filter form and command button for this query. as shown below this code is running fine now i want to add to the form for eg. 5 checkbox about stock id types. and eg. user wants to see 3 of 5 stok id types from these types . How can i add checkbox this values to the where clause to my LcWhere string ?

PS:sample codes including Turkish variables sorry for this but i need only sql syntax
WITH thisform 
lcWhere1 = 'between (crsvdplan.dosyano,thisform.txtdosyano.Value,thisform.txtdosyano1.Value)'
lcWhere2 = 'between (crsvdplan.orderterminhf,thisform.txthafta1.Value,thisform.txthafta2.Value)'
lcWhere3 = 'between (crsvdplan.sipterminhf,thisform.txthafta3.Value,thisform.txthafta4.Value)'
lcWhere4 = 'between (crsvdplan.fissevktar,thisform.txttertar1.Value,thisform.txttertar2.Value)'
lcWhere5 = IIF(EMPTY(.txttip.Value), '.t.', 'crsvdplan.mkod=thisform.txttip.Value')
lcWhere6= IIF(EMPTY(.txtfirma.value), '.t.', 'crsvdplan.ckod=thisform.txtfirma.Value')
lcWhere7 = 'between (crsvdplan.fistipi,thisform.txtnitelik.Value,thisform.txtnitelik2.Value)'
lcWhere8 = 'between (crsvdplan.termin,thisform.txtplter1.Value,thisform.txtplter2.Value)'
lcWhere9 = 'between (crsvdplan.tarih,thisform.txtgeltar1.Value,thisform.txtgeltar2.Value)'
lcWhere10 = 'between (crsvdplan.gecikme,thisform.txtgecikme1.Value,thisform.txtgecikme2.Value)'
lcWhere11 = IIF(EMPTY(.txtpartino.Value), '.t.', 'crsvdplan.partino=thisform.txtpartino.Value')
lcWhere12 = IIF(EMPTY(.txtrenkno.Value), '.t.', 'crsvdplan.labno=thisform.txtrenkno.Value')
lcWhere13 = IIF(EMPTY(.txtfinansdurumu.Value), '.t.', 'crsvdplan.idealyorum=thisform.txtfinansdurumu.Value')

ENDWITH

lcWhere = lcWhere1  + ' and ' + ;
lcwhere13 + ' and ' + ;
lcwhere2 + ' and ' + ;
lcwhere3 + ' and ' + ;
lcwhere5 + ' and ' + ;
lcwhere6 + ' and ' + ;
lcwhere8 + ' and ' + ;
lcwhere9 + ' and ' + ;
lcwhere10 + ' and ' + ;
lcwhere11 + ' and ' + ;
lcwhere12 + ' and ' + ;
lcwhere4  + 'and' + lcwhere7 

 SELECT dosyano,fistipi,fisno,ckod,cadi,mkod,madi,renkadi,labno,partino,gereken,;
 sum(sipmiktari)as toplamsiparis,sum(netmiktar) as toplam_net_gelen,;
 sum(brutmiktar) as toplam_brut_gelen,sum(brutmiktar)- sum(netmiktar) as brut_net_farki,;
 VAL(gereken)-sum(sipmiktari) as verileceksiparis,VAL(gereken)-sum(netmiktar) as kalansiparis from;
 Crsvdplan where &lcWhere;
 into curs crsresult nofilter

DO FORM forms\sorgufrm
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform