Report equation

  • Thread starter Thread starter Denver
  • Start date Start date
D

Denver

I have a report bound from a query,
with a record source Sum([ReadyAsBuilt])-this a Yes/No field record source.

I want to write a code or equation so that it appears on the report as NA
when it is equal to zero.

thanks for any help, I appreciate
 
It isn't clear if the Sum() is in the query or a control source of a text box
in a header or footer section in a report. Sum() should result in an
aggregated value from multiple records yet the appearance of NA seems more
like something from an individual record.

However, you can set the format property of the text box to disply "NA" when
the value is 0. There are four sections to the format property for numeric
values. These allow you to set different formats for positive, negative,
zero, or null values. Check out Help for the specific syntax... search on
Format Property Numeric.
 
Denver,
Directly summing a T/F (Boolean 0 or -1) field yields a negative number.
Use the Abs function to convert that to a positive value.

= IIF(Abs(Sum([ReadyAsBuilt])) = 0, "NA", Abs(Sum([ReadyAsBuilt])))
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
thanks Al Campagna it really works......

Al Campagna said:
Denver,
Directly summing a T/F (Boolean 0 or -1) field yields a negative number.
Use the Abs function to convert that to a positive value.

= IIF(Abs(Sum([ReadyAsBuilt])) = 0, "NA", Abs(Sum([ReadyAsBuilt])))
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Denver said:
I have a report bound from a query,
with a record source Sum([ReadyAsBuilt])-this a Yes/No field record
source.

I want to write a code or equation so that it appears on the report as NA
when it is equal to zero.

thanks for any help, I appreciate
 
Back
Top