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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 need help to sum up currency

Author  Topic 

blast
Starting Member

9 Posts

Posted - 2007-02-15 : 16:01:09
hi,
i need help in summing up currency values, wheni try to use this query
select sum(totalinc) as TotalIncome from main_add
i get solution as 2061
but i should get the total ass 2060.75

the datatype of the field in the table is double, not sure why im not getting the actual value instead of rounded values, please help! thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-02-15 : 16:15:43
Double isn't a valid SQL Server data type. So is your question related to SQL Server or not?

Tara Kizer
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-02-15 : 17:25:03
please post your table structure, some sample data


KH

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-15 : 17:40:59
select sum(1.0 * totalinc) as TotalIncome from main_add


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-15 : 17:41:22
Also make sure that the INT cutting does not appear until front-end.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -