SQL 2005
I'm trying to eliminate a division by zero issue.
Can someone assist with proper syntax for a statement like;
if sum(Field 1)[denominator] = 0
then 0
else sum(field 2)[numerator]/sum(field 1) [denominator]
Fields 1 and 2 also need to be summed.
I keep getting an invalid expression on my line where the if function is stated.
Apreciate any help.
Thanks,
Andrew
I'm trying to eliminate a division by zero issue.
Can someone assist with proper syntax for a statement like;
if sum(Field 1)[denominator] = 0
then 0
else sum(field 2)[numerator]/sum(field 1) [denominator]
Fields 1 and 2 also need to be summed.
I keep getting an invalid expression on my line where the if function is stated.
Apreciate any help.
Thanks,
Andrew