In MS Access 2013 VBA I get a syntax error in this SQL-string:
strSQL = \"INSERT INTO [man_year] ( man_year_val, year_int, main_research_area, organisation, man
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.