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
 General SQL Server Forums
 New to SQL Server Programming
 Cast as Money Subraction Formula

Author  Topic 

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-04-07 : 09:43:02
I have this formula that I am trying to create, but it keeps saying sum is not recognizing as a built in fuction name.
What do I need to do to correct this?

CAST((sum([Total Charges]- sum([Negotiated Allowed Charges])AS MONEY) AS CalSavings

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-07 : 09:44:25
what are datatypes of Total Charges & Negotiated Allowed Charges?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-04-07 : 09:46:02
Keep track of your paranthesises
SELECT	CAST(SUM([TOTAL CHARGES]) - SUM([Negotiated Allowed Charges]) AS MONEY) AS CalSavings



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2009-04-07 : 09:52:29

It is decimal (10,2)Null).

I think Peso, just helped me out. Thanks!

Go to Top of Page
   

- Advertisement -