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
 General SQL Server Forums
 New to SQL Server Programming
 multiple calculation in select
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

seeker62
Starting Member

40 Posts

Posted - 04/09/2013 :  12:54:35  Show Profile  Reply with Quote
(ISNULL(ISNULL(InvoiceVolume,0)*ISNULL(GrossPrice,0),0) + ISNULL(FuelSurchargeAmount,0) - ISNULL(FreightAmount,0) - ISNULL(MktgFeeAmount,0) - ISNULL(ValueAddedAmount,0)) AS CO2NetDue

does the multiplication and then does the add but does not do the subtractions. Why

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 04/09/2013 :  13:05:33  Show Profile  Visit russell's Homepage  Reply with Quote
probably because

ISNULL(FreightAmount,0)
ISNULL(MktgFeeAmount,0
ISNULL(ValueAddedAmount,0)

all evaluate to zero
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 04/09/2013 :  14:39:53  Show Profile  Reply with Quote
show some sample data and explain why you think subtract doesnt work

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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.08 seconds. Powered By: Snitz Forums 2000