Solved

SQLCMD leave 000s after rounding

Posted on 2008-09-29
1
398 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

895 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

18 Experts available now in Live!

Get 1:1 Help Now