Link to home
Start Free TrialLog in
Avatar of chokka
chokkaFlag for United States of America

asked on

How to filter multiple row of records in DataTable in the Dataset

I am currently filtering column name : SCR_DPY_SEQ which has records certain records by using the below syntax.

Syntax filters only few records and not all..

And this syntax is very cumbersome to manage .. Is there a better way to filter Multiple row of records in a Database within the Dataset ??

 
PTDs.Merge(ds.Tables("p_tree").Select("SCR_DPY_SEQ <> '30003039' AND SCR_DPY_SEQ <> '30003040' AND SCR_DPY_SEQ <> '30003041' AND SCR_DPY_SEQ <> '30003042' AND SCR_DPY_SEQ <> '30003043' AND SCR_DPY_SEQ <> '30003121' AND SCR_DPY_SEQ <> '30003122' AND SCR_DPY_SEQ <> '30003123' AND SCR_DPY_SEQ <> '30003124' AND SCR_DPY_SEQ <> '30003125' AND SCR_DPY_SEQ <> '30003203' AND SCR_DPY_SEQ <> '30003204' AND SCR_DPY_SEQ <> '30003205' AND SCR_DPY_SEQ <> '30003206' AND SCR_DPY_SEQ <> '30003207' AND SCR_DPY_SEQ <> '30003285' AND SCR_DPY_SEQ <> '30003286' AND SCR_DPY_SEQ <> '30003287' AND SCR_DPY_SEQ <> '30003288' AND SCR_DPY_SEQ <> '30003289' AND SCR_DPY_SEQ <> '30003367' AND SCR_DPY_SEQ <> '30003368' AND SCR_DPY_SEQ <> '30003369' AND SCR_DPY_SEQ <> '30003370' AND SCR_DPY_SEQ <> '30003371'"))

Open in new window

Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

You could use this....

PTDs.Merge(ds.Tables("p_tree").Select("SCR_DPY_SEQ NOT IN ('30003039', '30003040', '30003041' , '30003042', '30003043', '30003121', '30003122', '30003123', '30003124', '30003125', '30003203', '30003204', '30003205', '30003206', '30003207', '30003285', '30003286', '30003287', '30003288', '30003289', '30003367', '30003368', '30003369', '30003370', '30003371')"))
ASKER CERTIFIED SOLUTION
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chokka

ASKER

There is another column name : GROUP_CODE, i need to filter SG.

This will reduce the code.

PTDs.Merge(ds.Tables("p_tree").Select("GROUP_CODE not like SG"))

How to use - SELECT NOT LIKE
SELECT * From Table1 As t Where t.Name Not In(Select .t2.Name From Table2 t2)

This is one out of many variations.
Avatar of chokka

ASKER

Thanks , by any chance - can you please rewrite your syntax in a compilable ..
Avatar of chokka

ASKER

Thanks