Hi Duane,
In design view of the query behind the crosstab, I adjusted the 2 halves
of
the query view to be more easily read. When I was exiting the query, a
save
dialog popped up and I attempted to save the query. When I clicked OK to
save, a second dialog popped up stating:
"You must enter Group By in the Total row for a field that has a Column
Heading in the Crosstab row.
The values derived from the field or expression that you designate as the
Column Heading are used to group data in the crosstab query."
It will not allow me to save the query.
The following is in the top line of the last column of the query.
Field: Expr1: Format([VisitDate],"dd") In
("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15",
"16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","
31")
It is the only column in the query with
Crosstab: Column Heading
And
Total: Expression
When I set the to
Total: Group By (as I think the popup dialog is demanding)
In that same column, I get a row for each of the "O, E, X, D" entries.
Undesired.
So I set it back and exited without saving. All works well, but I did not
know if I should be concerned over this.
Here is the code copied from your post to the query and now back again.
Have
I done something wrong in the copy and paste process?
Thanks again for all of you help.
Bill
TRANSFORM First(qryVisitsandRateType.RateType) AS FirstOfRateType
SELECT qryVisitsandRateType.TherFullName, qryVisitsandRateType.PtFullName,
qryVisitsandRateType.CoFullName, Count(qryVisitsandRateType.RateType) AS
Total, Sum(Abs([RateType]="O")) AS TotalOs, Sum(Abs([RateType]<>"O")) AS
TotalEXDs
FROM qryVisitsandRateType
GROUP BY qryVisitsandRateType.TherFullName,
qryVisitsandRateType.PtFullName,
qryVisitsandRateType.CoFullName, qryVisitsandRateType.RateAmt,
qryVisitsandRateType.CoFullName
PIVOT Format([VisitDate],"dd") In
("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15",
"16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","
31");
Duane Hookom said:
I don't understand your additional comment. Share your sql view that creates
the error and the exact error message.
--
Duane Hookom
MS Access MVP
--
Yes Sir,
Only 2 controls in the report.
THANK YOU!!!!!!!!!!!
The billing report is up and running. I was also able to use the
query
for
the payroll process as well. I should have asked for help a month ago.
Just when you think you have a grasp on Access, one of these situations
crop up.
I do have an additional comment. When I view the query alone, I get a
message:
You must enter Group By in the Total row for a field that has Column
Heading in the Crosstab row.
However when I do that for the 1-31 col head, I get a row for every
O, E, X, D in the query. Not desired. So I changed it back.
Any concern over this situation?
Thanks again.
Bill
Are you attempting to create 2 X 31 controls (2 per column) or only 2
controls in the report. If only two in the report, change your SQL to:
TRANSFORM First(qryVisitsandRateType.RateType)
AS FirstOfRateType
SELECT qryVisitsandRateType.TherFullName,
qryVisitsandRateType.PtFullName,
qryVisitsandRateType.CoFullName,
Count(qryVisitsandRateType.RateType) AS Total,
Sum(Abs([RateType]="O")) as TotalOs,
Sum(Abs([RateType]<>"O")) as TotalEXDs
FROM qryVisitsandRateType
GROUP BY qryVisitsandRateType.TherFullName,
qryVisitsandRateType.PtFullName, qryVisitsandRateType.CoFullName,
qryVisitsandRateType.RateAmt, qryVisitsandRateType.CoFullName
PIVOT Format([VisitDate],"dd") In
("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15", "16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","
31");
Then you can create a sum of TotalOs and TotalEXDs in your report footer.
--
Duane Hookom
MS Access MVP
Hi All,
I have a report that is based on a crosstab query. It is a grid
style
report
with 31 columns for the visitdate and patients and therapists used
as
row
headings. What appears in the grid on the date a visit was made is the
code
for the type of visit. There are four different [therapytype]
codes.....O,
E, X, D. I am trying without success to count the total number of
E,
X
and
D
entries in one control in the report and the total O entries in another
control in the report. The report column controls are set to "01" to
"31"
as
the control source.
The query behind the report is qryVisitsandRateType_Crosstab.
Any assistance will be greatly appreciated.
Thanks,
Bill