• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

SQLCMD leave 000s after rounding

Hi

I have a sqlcmd script that runs a simple select query and outputs it to a .csv

However one of the fields rounds using

ROUND(dbo.KASSTRNS.KAS_BETRAG / 1.175, 2, 2) AS Expr2

But when I look at that in the out put file its change for example 1.22222 to 1.22000

Is there any way I can drop the 000 at the end??

Cheers

Brasso
0
brasso_42
Asked:
brasso_42
1 Solution
 
BinuthCommented:
cast(ROUND(dbo.KASSTRNS.KAS_BETRAG / 1.175, 2, 2)AS DECIMAL(18,2)) AS Expr2

 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now