MS Access VBA SQL query debugging select case

99封情书 提交于 2019-12-02 12:54:20

I see at least two issues with your SQL statement:

First, Access SQL does not support the CASE keyword. If you were thinking of the CASE ... WHEN construct in T-SQL (Microsoft SQL Server) then the equivalent in Access SQL is the Switch() function (ref: here). You can think of the Switch() function as doing

Switch(when1, then1, when2, then2, ...)

Second, as far as I know Access SQL only supports period (.) as the decimal symbol and comma (,) as the list separator, even if the Regional Settings on your machine specify other values (e.g., comma (,) as the decimal symbol and semi-colon (;) as the list separator). In other words, I'm fairly certain that

left(KU.man_year_source;3)

will never work; you'll need to use

left(KU.man_year_source,3)

instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!