How to use AX built in functions in select query

Hi All,

Consider a table customer as below

AccNo Name


1-101-1111 Sam

2-101-1112 Tom

3-201-1113 Tim

4-202-1114 Jim

5-203-1012 Jack


I want a select query to get Names of customer having “101” from 3rd to 5th position.

I can achieve the above requirement as below

customer cus;

;

while select cus

{

if(subStr(cus.AccNo,3,3) == “101”)

{

// do something

}

}

But i need something as below so that i can reduce the iteration of records.

customer cus;

;

while select cus

where subStr(cus.AccNo,3,3) == “101”

{

// do something

}

Thanks in advance,

Sai

You can use 'like’ keyword:

while select cus where cus.accno like ‘101

This question is duplicated on another forum. More answers are currently in the other place, so please continue the discussion there.