why error??
*This post is locked for comments
why error??
*This post is locked for comments
Because such syntax isn't valid. You can't ask SQL Server to execute X++ methods, and AX doesn't have any feature to directly translate X++ method calls to SQL functions. Get used to consulting Select statement syntax.
Regarding the field selection, you could fetch the whole LedgerAccount from database and than extract the substring in X++. Unfortunately you can't group by the function in any way in pure X++, but the solution would be a view with a computed column. You should be able to group by that.
Nevertheless note that it's a suspicious activity - it seems to suggest that you have multiple pieces of data in a single attribute, which is a violation of normal forms. The query would be much easier and much more efficient if you've designed the schema (or the way how you use the standard schema) correctly.
Because AX doesn't know how to call that function in a select statement.
You can however perform the select on the field (remove the subStr from the while select), and then in the while's block get the substring you need in the = line you perform.
André Arnaud de Cal... 291,391 Super User 2024 Season 2
Martin Dráb 230,445 Most Valuable Professional
nmaenpaa 101,156