>I have a users table which stores the user number and other conditions. The table may look like:
>
>
>
>Userno Attribute Value
>-------------------------------------
>3 Country Morocco
>3 Country Ukraine
>3 Factory New Line
>3 Factory Woven Mod
>3 Dept T58
>3 Dept T59
>
>
>Using the data above I want to set a filter condition on another table prior to printing named planrep. Therefore how can I set up a filter condition so it reads the table above and sets the filter on my planrep table? So for user number 3 it will set the filter so that the country=Morocco and Country=Ukraine.
>
>Is there any eay way to do this?
I don't know an easy way to do a filter, but for a report, you can create a query.
Option 1: Use a sub-query.
select * from OtherTable where Country in;
(select Value from Conditions where UserNo = 3 and Attribute = "Country");
into cursor Temp
report form ...
Option 2: Use the join syntax.
select OtherTable.*;
from Conditions join OtherTable on Conditions.Value = OtherTable.Country;
where UserNo = 3 and Attribute = "Country";
into cursor Temp
report form ...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)