View Full Version : Report of Project Details from one query plus one grouping query
LACSD 03-16-2010, 09:38 AM I'm looking for guidance on how to create a report. I have a few hundred projects, some of which are part of 19 larger projects. I have the project details located in different tables and I have a query that collects all the details and I used that query as the record source for my report. I have one problem unrelated to my grouped projects. For each project there is one detailed project sheet and some of the projects have maps that I want to be on the second page. If I don't have a map then I don't want a blank page, but I don't know how to make that happen. I also have a problem with some of the border lines around fields not showing up when I print to pdf when I have the borderwidth set to hairline.
My main problems is the 70 projects I grouped into 19 projects. I ran a query on my main report query to sum the costs. I can run the report from my main query and and leave out the 70 projects by requiring the GrpID to be Null. I'm not sure how I get the 19 grouped projects to show up though. Each project has an ID. Should I be using Visual Basic to get the grouped projects to show up in my report? Should I be grouping the 70 projects into 19 using Visual Basic instead of a query?
vbaInet 03-16-2010, 11:26 AM It looks like a fairly complex report. I would advise you start off with two things:
1. Building a query for Expenditures
2. Building a query for Funding
From the looks of the report, Expenditure and Funding will be two subreports.
The map will also be a subreport.
It seems that "219th Street Rehab" is the name of the company but I would imagine there is a company ID that is unique to each company. The three subreport controls afore-mentioned will be linked to the Main report via the Company ID.
Once you start I would be able to tell you how the subreports would be laid out.
LACSD 03-16-2010, 12:57 PM Hi,
I made a subreport for the picture. I didn't make subreports for funding and expenditures because I don't understand how that will get around my grouping problem unless you are saying I keep the report the way it is and add the subreports in addition to what I have. I would still have two query data sources that need to be mixed together in the report.
vbaInet 03-16-2010, 06:00 PM What is the grouping problem?
You haven't yet said what the ID is for your report?
LACSD 03-17-2010, 06:11 AM My main problems is the 70 projects I grouped into 19 projects. I ran a query on my main report query to sum the costs. I can run the report from my main query and and leave out the 70 projects (grouping) by requiring the GrpID to be Null. I'm not sure how I get the 19 grouped projects to show up in the report though. Each project has an ID (doesn't show up in text of report because it is just for ID purposes). Should I be using Visual Basic to get the grouped projects to show up in my report? Should I be grouping the 70 projects into 19 using Visual Basic instead of a query?
vbaInet 03-18-2010, 05:59 AM I don't understand what you mean by grouping 70 projects into 19 projects? Are you referring to the total number of unique projects after summing the costs?
I would have thought that should be a field in the recordsource?
LACSD 03-18-2010, 06:31 AM So I start with approximately 250 projects that have various details in different tables all linked by a projectID. For instance I have all the costs in one table and the project description and justification in a different table. Of those 250 projects, 70 projects needed to be grouped because they are really pieces of a project and I don't need detail sheets for pieces. The 70 small projects need to be grouped into 19 large projects that I gave GroupNames and GroupIDs to. I used a query to sum the costs for grouping the 70 projects to 19, but then I have two queries, one with 250 projects, but 180 projects have null GroupIDs so I can create a report without the 19 grouped projects but I don't know how to get the 19 grouped projects into the report.
vbaInet 03-18-2010, 06:44 AM Did you put Is Null in the GroupID criteria?
LACSD 03-18-2010, 06:50 AM Yes I put Is Null in the GroupID criteria. So I have the report with the 180 projects but I need the 19 grouped projects to show up also and I'm not sure how to do that.
vbaInet 03-18-2010, 07:03 AM All you need is Is Not Null. See if that works for you.
LACSD 03-18-2010, 07:11 AM :mad: That is what I have already. Like I said, the report would work fine if I didn't care that I am missing the 19 grouped projects. How do I get ONLY the 19 projects to show up and not all 70 projects that I summed into 19 using a separate query.
I have TWO queries and one report.
vbaInet 03-18-2010, 07:27 AM From what you've said and from post #9 if you want the 180 + 19 to show up then you need a UNION query. A Union between 180 and 19. See this link:
http://www.techonthenet.com/sql/union.php
Your report should be based on the query that displays the 19 grouped projects, other details would appear to be subReports
vbaInet 03-18-2010, 08:28 AM Your report should be based on the query that displays the 19 grouped projects, other details would appear to be subReports
Post #9 indicates that the OP wants to display the 180 and the 19. Not quite clear cut.
|