Report

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

I have a report based on a query. some of the results in
the report come out as 0. I would like to change all 0
values to 1. please help!!
 
hi,
In your query header that has the zeros put this:
yourQueryfield:Iff([YourQueryFiled]=0,1,[YourQueryField])
 
Minor correction, the function is IIf() not Iff().
Since this is displayed in a text box, you could use the Format property to
change the display of 0 to 1.

--
Duane Hookom
MS Access MVP


hi,
In your query header that has the zeros put this:
yourQueryfield:Iff([YourQueryFiled]=0,1,[YourQueryField])
-----Original Message-----
I have a report based on a query. some of the results in
the report come out as 0. I would like to change all 0
values to 1. please help!!
.
 
instead of
SELECT myfield
say
SELECT iif(myfield<>0,myfield,1) as myfield_

the "as" clause is necessary so that the result field name is
unambiguous, so you will have to change your report to reference
myfield_ instead of myfield.

Hope this helps,

Tim
 
Back
Top