View Full Version : Sum "0" Values...


gray8015
09-02-2010, 08:39 AM
Hi, I'll try to explain this briefly...
I have a database that tracks rugby games over many seasons. All works well until I try to create a grand total of points for each player. As the values associated with tries, penalties, etc have chnaged over the years, I store the values based on the season played.
My report shows PlayerName, Tries, Conversions, Penalties, DropGoals and sums the values for each player. Now I would like to sum ALL of the points for each player. It works fine if the player has at least 1 of all of the above - but that's not normally the case. As soon as Access hits a blank value (if the player scored no penalties), the result is a blank in the TotalPoints column.
I know this is a bit complicated.
I have copied a small sample which works only if Tries and Conversions are both greater than 0:
=([Tries]*[TryValue])+([Conversions]*[ConversionValue])
Any suggestions? Thanks for your time. Kind regards...

boblarson
09-02-2010, 08:53 AM
Use the NZ function:


=(Nz([Tries],0)*Nz([TryValue],0))+(Nz([Conversions],0)*Nz([ConversionValue],0))

Freshman
09-02-2010, 08:54 AM
Try using the NZ function. See below.What it does is replace the null value with a chosen default value.Note: It doesn't have to be 0.=(Nz([Tries],0)*Nz([TryValue],0))+(Nz([Conversions],0)*Nz([ConversionValue],0))

Freshman
09-02-2010, 08:55 AM
Sorry Bob - we answered same time :)

boblarson
09-02-2010, 08:56 AM
Sorry Bob - we answered same time :)

No worries - it happens fairly frequently. :)

gray8015
09-02-2010, 12:37 PM
Wow - You're both brilliant! Thanks so much!