Karen-
End Sub
Happy day everyone! I hope that everyone is doing well. I need some help with a report that I'm trying to create.
I have a crosstab query that I created. I want to create a report with the results because I want to add other subreports to the report. Here is the background information.
I have two tables: AllEnrollments and tblAgents. I need to count the reps sales, e.g. number of members within a date range. I have a query that has member data linked to the agents table by RepID. I named the query [qryNFP Rep Production]. The query result has 4 columns: RepID, Agent Name, AllDates (which is the sale date) and HCIN (which is the unique identifier). I created the crosstab from this query so that the row headings are the Agent names, the column headings are the days of the month (ex. 1, 2, 3...) and the value as the count of HCIN. Here is the code for the crosstab query.
TRANSFORM Count([qryNFP Rep Producation].HICN) AS CountOfHICN
SELECT [qryNFP Rep Producation].[Agent Name], Count([qryNFP Rep Producation].HICN) AS [Total Of HICN]
FROM [qryNFP Rep Producation]
GROUP BY [qryNFP Rep Producation].[Agent Name]
PIVOT Day([qryNFP Rep Producation]![AllDates]);
From here I had Access create a report. The resulting report looks great. Now comes the part where I'm stuck. The field names are the day (1, 2, 3...) so that I can run this report for any month without have to change the field names. The problem is that all of the months don't end on the same day. So, if I create the report for 30 days, the 31st date doesn't get added and if I create the report for 31 days, Access is looking for a field named 31 which not all of the months have.
Is there a way to make this report work the way that I want it to?
I really appreciate your help.
Karen
Posted by: John Viescas <johnv@msn.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar