Need SQL to CAST column as INTEGER

  • Need SQL to cast the column "ID" as an INTEGER:

    SELECT ID, Desc AS 'Domain Name'  FROM TBL_A order by 1

    thx-

     

    BT
  • What is the datatype of the ID column?

    Have you tried

    Select cast(ID as Integer) as ID, Desc AS 'Doman Name' from TBL_A order by 1?

     

  • 2 cents worth....  Don't order by ORDINAL position it may/may not come back and bite you.  Instead ORDER BY [ID], SQL will use the "derived" value for the ordering....



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

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

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