Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Displaying money values in correct format

$
0
0

Hi everyone,

I’m having an issue with a column format, I am running a Merge query and everything work ok, however the ProductUnitNetPrice column is displaying the money value like;

 1940.00 it should be 19.40

I have the column ProductUnitNetPrice type set as decimal(12, 2)

What’s the best way to fix this?

Can it be resolved during the Merge or is it better to run an update query?

Any pointers much appreciated.

My Merge query is something like this

MERGE INTO Products as dest
USING Products_Import as src
on dest.ProductID = src.ImportID
and dest.CodeID = src.CodeID

WHEN NOT MATCHED BY TARGET THEN
    INSERT (A,B,ProductUnitNetPrice )
    VALUES (src.A,src.B,src.ProductUnitNetPrice )

WHEN MATCHED THEN
    UPDATE SET
	   A = src.A,
	   B = src.B,
	   C = src.ProductUnitNetPrice 

WHEN NOT MATCHED BY SOURCE THEN
    UPDATE SET 
	   Discontinued  = 1;



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>