Filter DataTable with multiple conditions

datatable
studio

#1

So far all the guide and post I see online only has a single condition like dt.Select("[ColumnX]=‘Test’"). Is there a way to filter out the dataTable with 2 conditions, for example, dt.Select("[ColumnX]<>‘Test’") and dt.Select("[ColumnX]<>‘Sample’"). I have tried it out personally and I can’t seem to get it working.


#2

@poogy112
Try this:
dt.Select("[ColumnX]<>‘Test’ and [ColumnX]<>‘Sample’")


#3

@poogy112, To make it more simpler use this dt.Select("[ColumnX] Not in (‘Test’,‘Sample’)"). You can add multiple conditions here.

Regards,
Dominic :slight_smile:


#4

@599712
Concise and better syntax than my suggestion, thanks!:grinning: