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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Report from Query

Status
Not open for further replies.

Adams

Technical User
Mar 10, 2001
44
0
0
US
I have created a query that contains the data that I need for a report. I would just like to use certain fields from the query. Would I need to create VBA coding to do this.

Query
Sales_D
Sales_I
Comm_D
Comm_I

When I place Sales_D on the report it reports two lines.
The total for Sales_D and Sales_I. I understand why because there are two rows in the query. And it is coming back with the information that I am asking.
 
Can you give more information?

Quote: When I place Sales_D on the report it reports two lines. The total for Sales_D and Sales_I. I understand why because there are two rows in the query. And it is coming back with the information that I am asking.


--- Is that what you want, or are you trying to accomplish something else?

What is it that you want to do, please be specific in explaining what you want written to code. Thanks



misscrf

Management is doing things right, leadership is doing the right things
 
What I am pulling into my query is Total sales for Domestic and International travel. The query is being grouped by Domestic/International. I have included if statements in the query If field name = D then Sales else 0 (Name Sales_D) and I have done the same thing for International Sales. In my query under Sales_D is the total sales for domestic and in the next row under Sales_D is 0. It is then opposite for International, under Sales_I on the first row is 0 and second row is the amount of international sales. What I would like to accomplish on the report

Domestic Sales 1,000
International Sales 500

And what is happening is
Domestic Sales 1,000
0
International Sales 500
0

 
looks like and issue with the iif statement. Check if your are evaluating text or numeric. If you put else 0 you will get a 0 listed, if you want nothing, put else "" or " ".

misscrf

Management is doing things right, leadership is doing the right things
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top