Converting varchar value late to data type int

  • I am getting this error when I'm trying to run a sql script that I'm converting from access 07. The column in the table that i'm trying to update is a text field and should either have Late or remain blank.

    here's a line of the code in question

    CASE WHEN [SH Arv D Loc Date] > [End Date] THEN 'Late' ELSE 0 END AS LTLOT

    Msg 245, Level 16, State 1, Line 1

    Conversion failed when converting the varchar value 'Late' to data type int.

  • You have the else clause using an integer. Try something like this.

    CASE WHEN [SH Arv D Loc Date] > [End Date] THEN 'Late' ELSE '' END AS LTLOT

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply