Skip to content
Advertisement

ms-access-2010 returns #func[exclamation mark]

I have a sql-statement which includes a switch, i want to execute on ms-access-2010.

sql:

In my result, the column ‘some_column’ is always #Function!

If i do not use the switch-statement and add the sub-selects from the two cases as normal selected-fields like this:

i don’t get any problems (There are only a couple of rows where there is no value inside of SOME_COLUMN_1 AND SOME_COLUMN_2).

What is causing the result of #FUNCTION! here?

Advertisement

Answer

The Switch statement requires an even number of arguments. You’re only passing 3 arguments, thus causing an error.

You can either use IIF, or add an additional comparison argument (Perhaps just True as 3rd argument if you want to return the last argument if the first one isn’t true).

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement