Solved

SQLCMD leave 000s after rounding

Posted on 2008-09-29
1
395 Views
Last Modified: 2009-07-29
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
Comment
Question by:brasso_42
1 Comment
 
LVL 14

Accepted Solution

by:
Binuth earned 500 total points
ID: 22594720
cast(ROUND(dbo.KASSTRNS.KAS_BETRAG / 1.175, 2, 2)AS DECIMAL(18,2)) AS Expr2

 
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
OPENDATASOURCE 8 31
get all customers 2 39
Where clause in stored procedure 8 38
Problem with SqlConnection 5 117
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now