Divide by Zero (Null)

I

If

Hello,

I have this code that works

%DDD: Sum(IIF([datas.AAA]=0;0;[datas.DDD]/[datas.AAA]))


but the second does not

%DDD: Sum(IIF([Sum(datas.AAA)]=0;0;[Sum(datas.DDD)]/[Sum(datas.AAA)]))



My Diviser should be this (Datas.AAA in my exemple):

Sum([datas.AAA]+[datas.BBB]+[datas.CCC])


Someone would have an idea?
Thanks for your reply.

Yves
 
M

MGFoster

If said:
Hello,

I have this code that works

%DDD: Sum(IIF([datas.AAA]=0;0;[datas.DDD]/[datas.AAA]))


but the second does not

%DDD: Sum(IIF([Sum(datas.AAA)]=0;0;[Sum(datas.DDD)]/[Sum(datas.AAA)]))



My Diviser should be this (Datas.AAA in my exemple):

Sum([datas.AAA]+[datas.BBB]+[datas.CCC])


Someone would have an idea?
Thanks for your reply.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can't SUM a SUM, i.e., you can't have SUM(SUM(xxx)). If you want to
do that you'll have to have 2 queries: one to do the inner sums and the
second to do the outer sums (using the first query as a data source).
E.g.:

Query1:
SELECT SUM(column_A) As SumA FROM table_name

Query2:
SELECT SUM(SumA) As TotalSumA FROM Query1

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSMmNq4echKqOuFEgEQKNCQCfQl48OfIRwC5nq0ZQw+oF0i4N6CgAnRgD
7ZBwTt03Evw9O7BNUoh/MqRp
=aXnz
-----END PGP SIGNATURE-----
 
Top