OK, please stay with me on this one!
I need to do a report on the information I have in my database and I am struggling to decide how best to provide the record source for the report.
I have ProjectCodes, each of which can have more than one Contractor assigned to them. For each contractor, they are given a budget, and each budget can be approved or not.
For my report, I need to be able to display a count of the number of ProjectCodes a specific Contractor has been assigned to (as an example, let's call it ACME). I then need a count of how many of ProjectCodes ACME have been assigned to where they have been given a budget, and a count of how many ProjectCodes ACME have been assigned to where they have also been given a budget and where this budget has been approved.
The first part of this (Count how many ProjectCodes ACME is assigned to) is covered by my following query:
However, in order to get the next two 'Counts', it seems to me I need to use two more queries as I have tried to do it all in the same query and it doesn't seem to work.
I will then have the problem of trying to create a report based on 3 queries and I am not sure how to do that!
The other way I thought of doing it was creating some VBA code which would run series of SQL queries (similar to the one above) to obtain my values, insert these into a temporary table using an SQL statement and then base my Report of that table.
Does anyone have any thoughts on this? The VBA / SQL method seems clumsy but how else am I going to create my report if I need multiple queries to provide my data? Or, can I obtain all the 'Counts' I need from one query?
Tek-Tip gurus - over to you.
Thanks.
I need to do a report on the information I have in my database and I am struggling to decide how best to provide the record source for the report.
I have ProjectCodes, each of which can have more than one Contractor assigned to them. For each contractor, they are given a budget, and each budget can be approved or not.
For my report, I need to be able to display a count of the number of ProjectCodes a specific Contractor has been assigned to (as an example, let's call it ACME). I then need a count of how many of ProjectCodes ACME have been assigned to where they have been given a budget, and a count of how many ProjectCodes ACME have been assigned to where they have also been given a budget and where this budget has been approved.
The first part of this (Count how many ProjectCodes ACME is assigned to) is covered by my following query:
Code:
SELECT Count([01tblProjectControl].ProjectNumberCode) AS CountOfProjectNumberCode
FROM 01tblProjectControl INNER JOIN 10tblProjPropEstimateOriginalEQs ON [01tblProjectControl].ControlNumber = [10tblProjPropEstimateOriginalEQs].ControlNumber
WHERE ((([10tblProjPropEstimateOriginalEQs].Contractor)="ACME"));
However, in order to get the next two 'Counts', it seems to me I need to use two more queries as I have tried to do it all in the same query and it doesn't seem to work.
I will then have the problem of trying to create a report based on 3 queries and I am not sure how to do that!
The other way I thought of doing it was creating some VBA code which would run series of SQL queries (similar to the one above) to obtain my values, insert these into a temporary table using an SQL statement and then base my Report of that table.
Does anyone have any thoughts on this? The VBA / SQL method seems clumsy but how else am I going to create my report if I need multiple queries to provide my data? Or, can I obtain all the 'Counts' I need from one query?
Tek-Tip gurus - over to you.
Thanks.