web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Select SUM Nvarchar

(0) ShareShare
ReportReport
Posted on by

Hello everyone!

I need your help..

I have a SUM select query but the data type is NVARCHAR. in mssql it is recommended to use CAST, what if on AX?

select TransId,PRODUCTID,Sum(Cast(Qty As Decimal(10,2))),Sum(Cast(QTYSCAN As Decimal(10,2)),TransType 
from TempBarcode1
group by TempBarcode1.TransId,TempBarcode1.PRODUCTID,TempBarcode1.TransType
where TempBarcode1.TransType == 'PickingListRegistrasi' &&
TempBarcode1.TransID == SalesParmTable.SalesId

Thanks!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    You cannot do this in AX, so either store it as a decimal or change it to while select and convert to real inside of the loop.

  • Martin Dráb Profile Picture
    239,592 Most Valuable Professional on at

    If you store Qty as string, the key problem in in your data model. You'll be able to query the data easily when you switch to the right data type.

  • Community Member Profile Picture
    on at

    thank you sir, I understand, but this data has been used on some ax modules

  • Community Member Profile Picture
    on at

    thank's sir, I'm Try

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 28

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans