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
 multiple calculation in select

Author  Topic 

seeker62
Starting Member

40 Posts

Posted - 2013-04-09 : 12:54:35
(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

5072 Posts

Posted - 2013-04-09 : 13:05:33
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

52326 Posts

Posted - 2013-04-09 : 14:39:53
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
   

- Advertisement -