>Hello everyone,
>I would like to know how to pass a parameter to a view's "where" clause for conditions. For example, in different areas I may have different "where" clause conditions. In one instance, I may have "cField1 = 'x'" and in another instance "cField2 = 'y' .AND. !empty(cField1)". Is this possible? I had attempted the following but it did not work: "create sql view test as select * from myTable where ?x"
>then before issuing the "use test" I assigned x="cField1 = 'x'". I would appreciate any suggestions.
In addition to what's already been said you can also do
create view YourView as select * from YourTable ;
where (lnCondition=1 and YourTable.cField1='x') or ;
(lnCondition=2 and !Empty(YourTable.cField1) and YourTable.cField2='y')
if lnCondition is set before you run your view it will work
It's probably better to have different view's though..
Arnon