Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I'm trying to fetch the required records using where condition in the script.
Please lemme know whether the syntax i'm using is accurate or not.
Where Name='A' and (Zone='1' or Zone='2' or Zone='3' or Zone='9') and Name='B' and (Zone='12' or Zone='24' or Zone='37');
Please help.
That looks as if it will never return anything as Name will never equal 'A' and equal 'B'.
A complete guess here as to what your requirements are but this would probably return some rows :
Where
( Name='A' and (Zone='1' or Zone='2' or Zone='3' or Zone='9') )
or
( Name='B' and (Zone='12' or Zone='24' or Zone='37') );
That looks as if it will never return anything as Name will never equal 'A' and equal 'B'.
A complete guess here as to what your requirements are but this would probably return some rows :
Where
( Name='A' and (Zone='1' or Zone='2' or Zone='3' or Zone='9') )
or
( Name='B' and (Zone='12' or Zone='24' or Zone='37') );
Hi Bill,
There were many Zone values under Names A and B
I wanna return values only Zone = 1,2,3,9 from A
and
Zone = 12, 24, 37 from B.
Its working...:)
Can i use the same logic for multiple parameters like Name C, D. ..etc..?
Hi BIll,
Can i use Zone='1*' to fetch all the zonez starting with 1????
It could look neater with the Match() function :
Where
( Name='A' and Match ( 'Zone' ,'1' , '2' , 3' , '9') )
or
( Name='B' and Match ( 'Zone' , '2' , '24' , '37') ) ;
... and yup, you should be add same logic for your other Name values.
[Editted as I did a typo]
Still another typo: no quotes around the field name... I won't tell anyone however
P.
Use Wildmatch(Zone, '1*') instead of Match(Zone, '1') if you want to play with wildcards in Bill's example above. See QV Desktop help for more info.
Hi Peter,
Thanq Verymuch.