Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3218

How to add together numeric fields when one of the fields might be null

$
0
0

Hello All,

 

i'm creating a "lead assessment machine" for my company built into SAP, and it basically consists of 6 drop down menu's with numeric values in then a description of what each numeric value means, so for instance:

 

We find a company called X and this is how we put them through out lead assessment:

 

Location Score: They are in our local delivery area - 20 points

Spend Score: They spend over 15k - 0 points

Credit Rating: 70+ - 10 points

Mix of Products: 5 products - 0 points

Industry - Manufacturing - 10 Points

How company buys - Goes out to tender - 5 points

 

that gives this lead 45/100 points

 

I can add this up within SQL because nothing was left blank, but if i did the following:

 

Location Score: They are in our local delivery area - 20 points

Spend Score: They spend over 15k - 0 points

Credit Rating: 70+ - 10 points

Mix of Products: (LEFT BLANK as we do not know)

Industry - Manufacturing - 10 Points

How company buys - Goes out to tender - 5 points

 

This will not add up, as there is a null value, it cannot add 45+null it just becomes blank. When I ask the query to treat the nulls as 0 or the '' as 0 that doesn't work either. But when I want to filter blanks out in my query and say where <> '' and it works fine?

 

Any ideas? Sorry if this has confused anyone!


Viewing all articles
Browse latest Browse all 3218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>