B
briank
I am trying to reference a column in the same query (DateCalc2) for purposes
of grouping. When I run the query, I get a message: that MS Access can't
find the name of the column in my expression. I have read that referencing
of this sort is not the best way to go but cannot think of an alternative.
Any help would be appreciated.
SELECT Format([Date],"mmm yy") AS DateCalc, Format([Date],"yyyymm") AS
DateCalc2, Avg([On Task]+[Transition Movement]) AS TotalClients,
Avg(DSum("[On Task]+[Transition Movement]","tblFlexRatings"," [Hospital No] =
Forms![frmMain]![frmClient].Form![HospitalNo] and [DateCalc2]=
Format([Date],'yyyymm') ")) AS TotalClient
FROM tblFlexRatings
WHERE (((tblFlexRatings.Date) Between
[Forms]![frmFlexRatingsPopup]![BeginningDate] And
[Forms]![frmFlexRatingsPopup]![EndingDate]))
GROUP BY Format([Date],"mmm yy"), Format([Date],"yyyymm")
ORDER BY Format([Date],"yyyymm");
of grouping. When I run the query, I get a message: that MS Access can't
find the name of the column in my expression. I have read that referencing
of this sort is not the best way to go but cannot think of an alternative.
Any help would be appreciated.
SELECT Format([Date],"mmm yy") AS DateCalc, Format([Date],"yyyymm") AS
DateCalc2, Avg([On Task]+[Transition Movement]) AS TotalClients,
Avg(DSum("[On Task]+[Transition Movement]","tblFlexRatings"," [Hospital No] =
Forms![frmMain]![frmClient].Form![HospitalNo] and [DateCalc2]=
Format([Date],'yyyymm') ")) AS TotalClient
FROM tblFlexRatings
WHERE (((tblFlexRatings.Date) Between
[Forms]![frmFlexRatingsPopup]![BeginningDate] And
[Forms]![frmFlexRatingsPopup]![EndingDate]))
GROUP BY Format([Date],"mmm yy"), Format([Date],"yyyymm")
ORDER BY Format([Date],"yyyymm");