title: MS Access VBA SQL query debugging select case
body: <p>In MS Access 2013 VBA I get a syntax error in this SQL-string: </p>
  
  <pre><code>strSQL = "INSERT INTO [man_year] ( man_year_val, year_int, main_research_area, organisation, man_year_source ) SELECT KU.[2007], '2007' AS Expr1, " _
  &amp; "select case right(left(KU.man_year_source;6);2) like 'Hu' 3 case right(left(KU.man_year_source;6);2) like 'Sa' 1 case right(left(KU.man_year_source;6);2) like 'Te' 2 case right(left(KU.man_year_source;6);2) like 'Su' 4 case right(left(KU.man_year_source;6);2) like 'Ud' 5 AS Expr2, " _
  &amp; "4 AS Expr3, " _
  &amp; "select switch" _
  &amp; "(left(KU.man_year_source;3) like '1. '; 1;" _
  &amp; "left(KU.man_year_source;3) like '1.1'; 4;" _
  &amp; "left(KU.man_year_source;3) like '1.2'; 5;" _
  &amp; "left(KU.man_year_source;3) like '1.3'; 6;" _
  &amp; "left(KU.man_year_source;3) like '1.4'; 7;" _
  &amp; "left(KU.man_year_source;3) like '1.5'; 8;" _
  &amp; "left(KU.man_year_source;3) like '1.6'; 9;" _
  &amp; "left(KU.man_year_source;3) like '2. '; 2;" _
  &amp; "left(KU.man_year_source;3) like '2.1'; 47;" _
  &amp; "left(KU.man_year_source;3) like '2.2'; 48;" _
  &amp; "left(KU.man_year_source;3) like '2.3'; 49;" _
  &amp; "left(KU.man_year_source;3) like '2.4'; 50;" _
  &amp; "left(KU.man_year_source;3) like '2.5'; 51;" _
  &amp; "left(KU.man_year_source;3) like '2.6'; 52;" _
  &amp; "left(KU.man_year_source;3) like '3. '; 3;" _
  &amp; "left(KU.man_year_source;3) like '3.1'; 53;" _
  &amp; "left(KU.man_year_source;3) like '3.2'; 54;" _
  &amp; "left(KU.man_year_source;3) like '3.3'; 55;" _
  &amp; "left(KU.man_year_source;3) like '3.4'; 56;" _
  &amp; "left(KU.man_year_source;3) like '3.5'; 57;" _
  &amp; "left(KU.man_year_source;3) like '3.6'; 58) from KU;"
  </code></pre>
  
  <p>I get the error in the CASE-part, but that might be because it hasn't reached the SWITCH-part yet. :-) Can anyone please help, I cannot find the error.</p>
  
  <p>Best pmelch</p>