cancel
Showing results for 
Search instead for 
Did you mean: 

Query result with Comma

former_member557244
Participant
0 Kudos

Sir,

While using SAP B1 HANA, I have this query

select TO_DECIMAL("DocTotal",8,2) from ordr where "DocNum"=500

The result look like this

1377370.00

But I want this result

1,377,370.00

Please help me

Accepted Solutions (0)

Answers (2)

Answers (2)

pfefferf
Active Contributor

The result you want is a formatted result. Formatted results are produced by the different clients depending on settings done by the user and/or influenced by regional conditions. Please check if your client you are using has such settings.

If you are "just" using a SQL console you can use function TO_NVARCHAR to format your output properly (see examples in documentation).

former_member557244
Participant
0 Kudos

Yes sir, this time I used this query

select TO_NVARCHAR("DocTotal",'9,999,999.00') from ordr where "DocNum"=500

But it show this error message

inconsistent datatype: DECIMAL or VARCHAR are invalid function argument types: line 1 col 8 (at pos 7)