Re: Nz problem

Tech-Archive recommends: Speed Up your PC by fixing your registry



As noted, I first tried Allen's solution and it seems to work fine. I will
try this, too, but it makes better sense to me to set the output type after
the calculation. On the other hand, I can understand performing the
calculation on data that has already been "set". Thank you for the idea.

No, there are no numerical fields in the data (part in question, anyway) and
I did intend to COUNT to develop the crosstab query data. Once it is being
analyzed in Excel, it is often necessary to SUM rows and columns of those
COUNTS and those were the steps being taken.

Tuffy


"MGFoster" wrote:

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

Put the Nz() function inside the COUNT() aggregate function:

TRANSFORM COUNT(Nz(RECV.BAND,0)) As CountOfBand

Actually, my guess is you want to sum not count. Count() will count
zero as 1 - COUNT(0) = 1. SUM(0) = 0.

TRANSFORM SUM(Nz(RECV.BAND,0)) As BandSum

--
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/AwUBRUrF6YechKqOuFEgEQLkiwCcCNdb+XdJu6zHojiMjx2KkayKNbYAn1U8
GBbiZgIDVJo8K9CHPU6pqVVw
=q6pb
-----END PGP SIGNATURE-----

TuffyE wrote:
As the solution to "filling" a crosstab, it was suggested that I use this
function. The line is:

TRANSFORM Nz(Count(RECV.[BAND]),0) AS CountOfBAND

However, that generates some results that I just can't understand when I
analyze it with Excel. The data part of the output table appears to have
values, some of which are "0" and some are not. The first thing that I
noticed was that the Excel SUM function would always come up with a result of
0, whether or not there appear to be any other values or not. Hmmm, sounds
like a Text problem with the 0 filling. So, I tried a SUM with only the
values and that still yielded 0. Just for the heck of it, I tried a simple
cell addition (eg. =G2+G4) and that does add (18 in example below). What
does all of that mean? I didn't think there was that kind of difference
between "=SUM(G2,G4)" and "=G2+G4". Does the Nz cause it to output text
rather than values as the count? Is there a values version that will yield
"0" where that is the COUNT result?

000 1320 2059 0 0 1 9
000 1326 13 0 0 0 0
000 1330 346 0 0 3 9
000 1340 13 0 0 0 0
000 1350 24 0 0 0 0
000 1370 35 0 0 0 0
000 1390 53 0 0 0 0
000 1400 143 0 0 0 0
000 1410 4 0 0 0 0

2690 0 0 0 0
0
18


.



Relevant Pages

  • Re: Nz problem
    ... TRANSFORM COUNT) As CountOfBand ... TRANSFORM Nz,0) AS CountOfBAND ... The first thing that I noticed was that the Excel SUM function would always come up with a result of 0, whether or not there appear to be any other values or not. ...
    (microsoft.public.access.queries)
  • excel 97 how can i transform in the same cell 1.256.324 in 125.63
    ... So i want excel to transform for me automatically an old sum of money ...
    (microsoft.public.excel)
  • Re: Almost there !!!
    ... to give me 1*1*1 which is added to the sum of the products. ... Excel and Word Function Lists available free to good homes. ... In the first formula above the first two> arguments within>>the SUMPRODUCT are implicit IF statements that return> TRUE or FALSE. ...
    (microsoft.public.excel.misc)
  • Re: Excel beta - another bug
    ... Excel versions and therefore get the same results as from single column ... For A1:A1048576, the data is in a single column, so all three formulas sum ... has ever retained intermediate partial sums in 10-byte registers for SUM, ... updating algorithms for these calculations, but they have not done either. ...
    (microsoft.public.excel)
  • Re: Simple SUMIF Question
    ... simple =sum() to add up the values in a column. ... I am an ASP.NET programmer trying to use a 3rd party product to produce Excel ... Actually the odd numbered cells such as E:5, ... I have a footer row in which I want to display the SUM of the odd numbered ...
    (microsoft.public.excel.misc)