Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with a query and report

Status
Not open for further replies.

smalley

Programmer
Feb 8, 2001
17
0
0
US
I am looking for a way to write a query and display results on a report. Here are the tables and fields:
REGION SELLERS SALES
name seller_id date
branch branch seller_id
sellers_nm sale_type
amount
received(yes/no) - yes/no data type

region and sellers are joined on branch and sellers and sales are joined on seller_id.

I need to display the report as follows:
Region Name
Sale_Type # Required ____ # Received ____

The report is grouped by region and I only need the number required and the number received. I get the number required by counting the number of sellers for each sale_type. For instance, if I have a sale type "Cold Calls" and I have 4 sellers assigned to "Cold Calls" then 4 are required for that region. I get this information from the Sales table. Each seller will have a yes or no for each sale type and I need to know how many have a yes. The part that I am having problems with is getting the number of yes's. I have my report made and I have the total required and I can display the number of yes's and the number of no's but I don't know how to get rid of the no's.
Please help.
 
In your query type the following in a field.
Code:
NumOfYes: IIf([salesType]=True,1,0)
[code][b]
Set the total part of that field to [COLOR=blue]'Sum'[/color]
Change salesType to be the name of your field.
That should do it for you. The hardest questions always have the easiest answers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top