Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 query sum showing including teh decimal part
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cplusplus
Aged Yak Warrior

567 Posts

Posted - 01/23/2013 :  12:20:23  Show Profile  Reply with Quote
select query sum, want to show the decimal part upto 2 digits.

I am using the following all values are coming in round numbers.

SELECT FISCAL_YEAR, company, ACCOUNT,SUB_ACCOUNT,
sum(UNITS_AMOUNT),sum(ACCT_AMOUNT),sum(TRAN_AMOUNT),POSTING_DATE from prod.gltrans
WHERE FISCAL_YEAR = 2012
AND account BETWEEN 8000 AND 8999
GROUP BY FISCAL_YEAR,company, ACCOUNT, SUB_ACCOUNT,POSTING_DATE


Thank a lot for the helpful info.

jimf
Flowing Fount of Yak Knowledge

USA
2875 Posts

Posted - 01/23/2013 :  12:36:02  Show Profile  Reply with Quote
I don't see any reason why the numbers would be rounded. Either the unerlying data are ints, or it's a display issue in the front-end.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000