Newbie: Help with Derived Field in Report

S

shcram

I'm a new Access user and not very technical, so I hope someone can giv
me an easy way to solve my problem. With a query I extract the record
I need - a list of animals at our shelter. Then with a report I wan
to interpret some of the information from the query. For example, th
query tells me "male" or "female" for each animal. However, on th
report I want two columns - one for "male" and one for "female". I
the animal is male, I want to put a '1' under the "male" column and
'0' under "female" If animal is a female, then I want a '0' unde
"male" and a '1' under "female". Then I'll sum up the contents o
these derived fields at the end of the report. Can I do this wit
Report Wizard? or in Design mode? I'd rather stay away from SPL cod
- too complicated for me! Thanks, Su
 
T

Tom Lake

I'm a new Access user and not very technical, so I hope someone can give
me an easy way to solve my problem. With a query I extract the records
I need - a list of animals at our shelter. Then with a report I want
to interpret some of the information from the query. For example, the
query tells me "male" or "female" for each animal. However, on the
report I want two columns - one for "male" and one for "female". If
the animal is male, I want to put a '1' under the "male" column and a
'0' under "female" If animal is a female, then I want a '0' under
"male" and a '1' under "female". Then I'll sum up the contents of
these derived fields at the end of the report. Can I do this with
Report Wizard? or in Design mode? I'd rather stay away from SPL code
- too complicated for me! Thanks, Sue

If the table field that tells the sex of the animal is called Sex with
either "Male" or "Female in it then use this:

Create two new calculated columns in the query:

Male: IIf([Sex]="Male", 1, 0)

and

Female: IIf([Sex]="Female", 1, 0)

then you can put these Query columns in the report Detail section and Sum
them in the Report Footer.

Tom Lake
 

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