I'm trying to ORDER BY the first column in my Union Query. The problem is that the first column is a formatted field. Everything I have tried produces errors. Below is a sample of what I have.
I have tried Order By:
Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting' Syntax Error (missing operator)
Format([Month Reporting],"mmmm yyyy") Error stating the field is not selected by the query
[Month Reporting] Error stating the field is not selected by the query
SQL
SELECT Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting',[Portfolio]
From [qryRetrievalTotalsUS]
ORDER BY [Month Reporting]
Union ALL SELECT Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting',[Portfolio]
From [qryRetrievalTotalsCAD]
ORDER BY [Month Reporting]
UNION ALL SELECT Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting',[Portfolio]
From [qryRetrievalTotalsPR]
ORDER BY [Month Reporting];
Thoughts? Suggestions?
I have tried Order By:
Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting' Syntax Error (missing operator)
Format([Month Reporting],"mmmm yyyy") Error stating the field is not selected by the query
[Month Reporting] Error stating the field is not selected by the query
SQL
SELECT Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting',[Portfolio]
From [qryRetrievalTotalsUS]
ORDER BY [Month Reporting]
Union ALL SELECT Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting',[Portfolio]
From [qryRetrievalTotalsCAD]
ORDER BY [Month Reporting]
UNION ALL SELECT Format([Month Reporting],"mmmm yyyy") AS 'Month Reporting',[Portfolio]
From [qryRetrievalTotalsPR]
ORDER BY [Month Reporting];
Thoughts? Suggestions?