I have a table with 12 fields representing charges for each month. I have a report that I want to be fed the sum of the charges from last month. I don't want to update the query every month, so I'm trying this:
This is giving me a "data mismatch in criteria expression" error because it can't sum the string "DEC_CHARGE" . The field name is DEC_CHARGE but it isn't recognizing that.
Any ideas?
Code:
SELECT (SELECT Sum(Format(Now()-30,'mmm') & "_CHARGE")FROM TBL_CHARGEYTD) AS DEC_CHARGE1
FROM TBL_CHARGEYTD;
This is giving me a "data mismatch in criteria expression" error because it can't sum the string "DEC_CHARGE" . The field name is DEC_CHARGE but it isn't recognizing that.
Any ideas?