A
A
Ancure2017-11-21 13:06:07
SQL
Ancure, 2017-11-21 13:06:07

How to replace dot with comma for expression in SELECT?

There is a query of the form:
select field * 1.271 as [Amount]
from db.table
I have a task to replace dots with commas in the query results. If there was no multiplication, then it would be possible to apply replace, but in this version, I did not understand how to do it (
Please help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2017-11-21
@Ancure

replace with CAST/CONVERT, no?

A
Alexey Ukolov, 2017-11-21
@alexey-m-ukolov

I don't remember the exact syntax for REPLACE, but it should work like this:
select REPLACE(field, ...) * 1.271 as [Amount]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question