Yesterday I imported all of my data into a new database and now the following union query won't run. I get a message saying invalid bracketing of name Select[Field code
I understand from elsewhere on this forum that Access sometimes "rebrackets" queries but can anyone help with the correction.
Thank you in advance for any replies
I understand from elsewhere on this forum that Access sometimes "rebrackets" queries but can anyone help with the correction.
Thank you in advance for any replies
Code:
SELECT [FieldCode], Sum(Effect) AS SumOfEffect, Yr
FROM [SELECT [FieldCode],NYr0 as Effect,CInt([OM Application Year]) As Yr FROM qry2rptA1
UNION ALL SELECT [FieldCode],NYr1,CInt([OM Application Year]+1) FROM qry2rptA1
UNION ALL SELECT [FieldCode],Nyr2,CInt([OM Application Year]+2) FROM qry2rptA1
]. AS U
GROUP BY [FieldCode], Yr;