nz returning string

  • Thread starter Thread starter urbanista
  • Start date Start date
U

urbanista

I'm using Nz in a crosstab query to put in a zero when
the count is zero. I.e.:
TRANSFORM Nz(Count(TESTER.WEIGHTID),0) AS CountOfWEIGHTID

This returns a 0 when there aren't any cases that apply
for a given cell, but then these count fields are all
strings. I need them to be numeric. Help!
 
Try using the val function or one of the conversion functions such as CLng.
Since this is a COUNT, I would use CLng to force the data type to an integer number.

TRANSFORM CLng(Nz(Count(TESTER.WEIGHTID),0)) AS CountOfWEIGHTID

It is a fact that using NZ in an SQL statement often retypes the returned value
to a string.
 
Back
Top