>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
Sheena,
Revised a little. W/o sample data it's being hard where it fails. Try this one and inform me.
ldStart = ctod(Thisform.text1.value)
ldEnd = ctod(Thisform.text2.value)
if ldEnd < ldStart
ldTemp = ldStart
ldStart = ldEnd
ldEnd = ldTemp
endif
ldStart = max(ldStart, {01/01/100})
ldEnd = min(ldEnd, {01/01/9999}+364)
m.ComboValue = thisform.combo2.value
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 = m.ComboValue or coun_sum.nddetby = m.ComboValue) ;
and act_plan.follow_dte BETWEEN ldStart AND ldEnd ;
and act_plan.fld_up # 1 ;
into cursor finalcursor
If reccount() = 0
messagebox("There are no records found!", 48, "CATS")
Endif
set talk off
browse
REPORT FORM counrpt HEADING "ACTION PLAN BF REPORT" PREVIEW
Cetin