Thursday 5 February 2015

Using wild cards in X++ select statements

Some time a ago I had to make a select statement, excluding some batchId's which started with BN14.

In a select statement in X++, you can use wildcards like this; 

    while select inventBatch
    where inventBatch.inventBatchId like 'BN14*'


However, if you'd like to exclude a set of batches which start with BN14 you need a slight different statement:

    while select inventBatch
    where !(inventBatch.inventBatchId  like 'BN14*')

No comments:

Post a Comment