I just answered this.
The user firstly tagged his question with sql, function, and ms-access.
The solution to his question is to use VBA, and I have added the code to achieve it.
The problem is that my code is syntactically recognized as SQL and not VBA.
I have edited the question to add the vba tag, but that doesn't change anything.
Is there a way to force a specific language highligthing when you have a mix of several languages into the same answer?
lang-vba
andlang-sql
just before the 2 code blocks, and I see no changes :(