Y/N Count in Report

J

Jeff

I am having a problem and need some help. I have a few
fields that are Text formatted, with an entry of Y or N.
I am trying to use a count function in the Report Footer,
using: =Sum(IIF([FieldName}=N,1,0)) I am trying to
return a count of the values that are N. The probelm
that I am running into is that Access is not giving a
count of this field using the above code. I tried
chaning this field to a y/n format, and used the code
=Sum(IIF([FieldName],0,1)) which does return a value but
the field contents are displaying as -1 and 0 on my
report. What is the best way to both display th records
correctly as Y or N and also perform a report footer
count of the amt of records that have N?
Thank you for your help.
 
W

Wayne Morgan

Once you set the field to be a yes/no field, in the textbox on the report
set the format property to display the values as you desire. The built in
Options (format box on the Format tab) are Yes/No, True/False, and On/Off.
You can also do your own by changing the entry in the format box to

;\Y;\N

for Y or N. Note the leading semicolon as a place keeper.
 
J

Jeff

Thank you very much! It worked!
-----Original Message-----
Try

=Sum(IIF([FieldName}="N",1,0))

Jim
-----Original Message-----
I am having a problem and need some help. I have a few
fields that are Text formatted, with an entry of Y or N.
I am trying to use a count function in the Report Footer,
using: =Sum(IIF([FieldName}=N,1,0)) I am trying to
return a count of the values that are N. The probelm
that I am running into is that Access is not giving a
count of this field using the above code. I tried
chaning this field to a y/n format, and used the code
=Sum(IIF([FieldName],0,1)) which does return a value but
the field contents are displaying as -1 and 0 on my
report. What is the best way to both display th records
correctly as Y or N and also perform a report footer
count of the amt of records that have N?
Thank you for your help.
.
.
 

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

Top