• Help with a SQL Expression

    Author
    Topic
    #508198

    I need some help with a SQL Expression:

    CASE WHEN dbo.tblOffices.Office = ‘Leicester’ THEN ‘Leicester Office’ END

    It just brings an error, what is wrong with it?

    Viewing 1 reply thread
    Author
    Replies
    • #1591228

      Msg 102, Level 15, State 1, Line 1
      Naming anomaly near ‘Leicester’ . Should be ‘Leicestershire’.

      ๐Ÿ™‚

    • #1591237

      Luke,
      What is the error you are getting? Statement looks OK to me, if you realize that it will return NULL unless ‘Leicester’ is found. You might want to put in an ELSE statement.

    Viewing 1 reply thread
    Reply To: Help with a SQL Expression

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: