input character string does not follow style 112, either change the input ch

  • Hi,

    I'm getting an obscure issue when

    when I run this SQL statement

    SELECT  TOP 1 S_Date from tbl_name order by RowID

    I get  this error message :

    Msg 9807, Level 16, State 0, Line 1

    The input character string does not follow style 112, either change the input character string or use a different style.

    but it is OK when I leave out the "order by RowID".

    Both SQL Statements will return the same first row and the value of S_Date is NULL and is of type date

    Any help welcome!!!

    Thanks,

    Eamon

     

     

  • What is the DataType of RowId?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • are you sure that tbl_name  is really a table and not a view?

    that SQL so simple would give that error if it was from a view with invalid data on the underlying table(s)

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

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