Report equation

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
 
D

Duane Hookom

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.
 
A

Al Campagna

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."
 
D

Denver

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dealing with NA response 1
#name? 1
bound vs unbound main report 3
Using Record Count in an equation 3
Text Field 5
Text Box Format 2
*REPOST* If then Else Statment in Report 12
Calculating the Total 10

Top