SQL Server Forums
Profile | Register | 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
 New Topic  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
5071 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
52249 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  
 New 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.05 seconds. Powered By: Snitz Forums 2000