Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql select /combo box problems
Message
From
22/07/1998 11:41:00
 
 
To
22/07/1998 03:26:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00119976
Message ID:
00120223
Views:
28
Hi Cetin:

Thanks for helping me again. I have one other small problem, when I select the
casemang or nddetby person from my combobox list I get all the records
for the criteria - meaning if I select noone I get all the records and If a select " bill smith" I get all the reocrds even if he isn't the casemang or nddetby for this record. Do I need to put coun_sum.casemang = thisform.combo2.value or coun_sum.nddetby = thisform.combo2.value somewhere else? Here is the code.
str = ""
If empty(ctod(Thisform.text1.value)) and empty(ctod(Thisform.text2.value))
str = " "
Else
If empty(ctod(Thisform.text1.value))
str = "and act_plan.follow_dte <= ctod(Thisform.text2.value)"
Endif
If empty(ctod(Thisform.text2.value))
str = "and act_plan.follow_dte >= ctod(Thisform.text1.value)"
Endif
If not empty(ctod(Thisform.text1.value)) and not empty(ctod(Thisform.text2.value))
str = "and act_plan.follow_dte >= ctod(Thisform.text1.value) and act_plan.follow_dte <= ctod(ThisForm.text2.value)"
Endif
Endif
set talk on
select distinct client.sin, allt(client.surname) + ", " + allt(client.firstname);
as fullname, client.phone1;
from client;
inner join coun_sum;
on client.sin = coun_sum.sin;
inner join act_plan;
on act_plan.sin = coun_sum.sin;
where(coun_sum.casemang = thisform.combo2.value or coun_sum.nddetby = thisform.combo2.value);
and !empty(act_plan.follow_dte) &str;
and act_plan.fld_up < 1 or act_plan.fld_up > 1;
into cursor finalcursor

If reccount() = 0
messagebox("There are no records found!", 48, "CATS")
Endif
set talk off



REPORT FORM counrpt HEADING "ACTION PLAN BF REPORT" PREVIEW
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform