Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How can I group by a field that has memo as its size?

Posted on by 20

Hello,

I am new to MSD AX and I got a task that tells me to group by some memo fields in a table, so I can copy the grouped data to another table.

whenever I write the code as:

Select * from table1

group by table1.memoField;

I get the following error: Container and unbounded string fields are not allowed in an ORDER BY or GROUP BY list.

How can I correct this error?

Thank you in advance,

Raimund Vysockij

*This post is locked for comments

  • Douglas Noel Profile Picture
    Douglas Noel 3,905 on at
    RE: How can I group by a field that has memo as its size?

    Other way is creating a view based on your table with an computed sql function column, maybe using a substring sql function and assign a appropriate edt (maybe string 40) on that field and selecting from this view grouped on the computed column?

    regards Douglas

  • Raimund Profile Picture
    Raimund 20 on at
    RE: How can I group by a field that has memo as its size?

    Is there a way to limit the length of the field in X++ then? So that it groups by the first 255 symbols?

    Something like: cast(table1.memoField as varchar(255));

    Thank you,

    Raimund Vysockij

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans