Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT with 4 conditions
Message
From
23/09/2005 14:47:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/09/2005 01:40:07
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01052132
Message ID:
01052522
Views:
8
>Yes, reuery() for listbox is after SELECT.
>( SELECTs ... are in DO CASE loop - and look like this:
>
>
>case thisform.C1.value==.T. .and. thisform.C2.value==.T. .and.thisform.C3.value == .F. .and. thisform.C4.value== .T.
> *
> SELECT NAZIV from OBJEKT WHERE alltrim(POGON) == thisform._C1 .and. ;
> TIP == thisform._C2 .and. ;
> GRUPA == thisform._C4 ;
> order by NAZIV into ARRAY THISFORM.IZABERI
>
>( thisfrom._Cn keeps last value from combobox )

Are you saying you have 16 cases here? Just hope you don't get two more checkboxes, because you'd have 64 CASEs... how about
cCondition=".t."
if thisform.c1.value
   cCondition=cCondition+" and alltrim(pogon)==thisform._c1)"
endif
if thisform.c2.value
   cCondition=cCondition+" and tip==thisform._c2)"
endif
... (stuff for c3 and c4 here... and more if you need)
select naziv from objekat where &cCondition;
   order by ...
That way you can build your condition as it comes. If all four checkboxes are .f., you get all the records.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform