4 Replies Latest reply on Jan 20, 2014 5:58 AM by Matt Lutton

    CASE function error message

    Leslie Henrickson

      I'm working with survey data, have reshaped the excel file, and am trying to create a new variable using CASE function but get the following error message:

       

      CASE [Response]

      WHEN '1 month or less ' THEN 1

      WHEN '1 to 2 months ' THEN 2

      WHEN '2 to 3 months ' THEN 3

      WHEN '3 to 4 months ' THEN 4

      WHEN '4 to 5 months ' THEN 5

      WHEN '5 to 6 months ' THEN 6

      WHEN '6 to 7 months ' THEN 7

      WHEN '7 to 8 months ' THEN 8

      WHEN '8 to 9 months ' THEN 9

      WHEN '9 to 10 months ' THEN 10

      WHEN '10 to 11 months ' THEN 11

      WHEN '11 to 12 months ' THEN 12

      WHEN '12 to 13 months ' THEN 13

      WHEN '13 to 14 months ' THEN 14

      WHEN '14 to 15 months ' THEN 15

      WHEN '15 to 16 months' THEN 16

      WHEN 'more than 16 months ‘ THEN 17

      WHEN 'Does not apply' THEN 0

      WHEN 'Select one' THEN 0 ELSE 0 END

       

      It highlights what is BOLD/Underlined above, with the message:  Unterminated string.

       

      Any ideas on what to change. Thanks in advance.