Error in Update query

  • Hi,

    I am trying to update columns within a table when several conditions are true (see below).

    UPDATE dbo.LSR_Prep

    SET

    Result = RTRIM(LTRIM(Crude_Result)),

    Result_4 = '1'

    WHERE

    RTRIM(LTRIM(Analysis_Code)) = '58'

    AND

    ISNUMERIC(RTRIM(LTRIM(Crude_Result))) = 1

    AND

    RTRIM(LTRIM(Crude_Result)) > 3;

    However, the following message is displayed:

    Msg 245, Level 16, State 1, Line 2

    Conversion failed when converting the nvarchar value '1.611226611' to data type int.

    All the columns are data type nvarchar. The 'Crude_Result' column contains numeric and alphanumeric data.

    Any ideas?

    Thanks in advance,

    Neal

  • The ISNUMERIC function is not as it appears. See this[/url] thread for details.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

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

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