How do I sort by a function-calculated value in a Microsoft Access query?
Posted on 2014-10-08
I have a calculated field in a Microsoft Access query. I duplicated this calculated field through a few different queries because I needed it there, but realized when I need to change the calculation (as I do regularly) it is so much easier and better to have the value be calculated in a function in a module. I thought this would be the perfect solution, but found that although I can sort a query on a field calculated in the query, it will not sort on the "same" value if it comes from a function. No clue why this would be. It says "Data type mismatch in query expression." when I ask it to sort. How can I pull this off? Surely there is a better way than to have to update the query every time in a dozen places.