November 30, 2007 at 6:50 am
In a query, how do I convert data in a field that is of the data type "Text" into something numeric (an integer, for example) ?
Thanks.
November 30, 2007 at 6:57 am
A text data type can only be converted to character type, ntext or xml types, explicitly converting to some other types is not allowed.
--Ramesh
December 4, 2007 at 9:28 am
convert(char(12),GETDATE()-1,101)
just takes the GET DATE ( todays date 08/23/2007 hh:mm:ss ) and converts it into the 101 format ( minus one day )
not sure if you are just looking for A convert statment but thought I would put this in just in case.
December 4, 2007 at 9:38 am
As ramesh stated you can to charcter types, if you need to go to numeric you have to CAST twice. Also, when dealing with trying to cast to numeric types you should consider using a funtion like IsNumeric to be sure the cast can legally be completed for a given row.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply