Help elsewhere on this forum helped me create the following union query. I have tried to link the output data to another query but am getting a "type mismatch in expression" error. I am trying to link the yr field to a number field. Can anyone tell me how to format the Yr as a number?
Code:
SELECT [OM Application Index],[Field Name],[Field Code],[Total N applied],[Total P2O5 applied],[Total K2O applied],[Total MgO applied],[Total SO3 applied], NYr0 as Effect, [OM Application Year] As Yr
FROM qry2FMA1
UNION ALL
SELECT [OM Application Index],[Field Name],[Field Code],[Total N applied],[Total P2O5 applied],[Total K2O applied],[Total MgO applied],[Total SO3 applied], NYr1, [OM Application Year]+1
FROM qry2FMA1
UNION ALL SELECT [OM Application Index],[Field Name],[Field Code],[Total N applied],[Total P2O5 applied],[Total K2O applied],[Total MgO applied],[Total SO3 applied],Nyr2, [OM Application Year]+2
FROM qry2FMA1;