Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Type conversion

Status
Not open for further replies.

jfras

IS-IT--Management
Oct 18, 2000
2
US
I'm looking for a way to convert a field retrieved with a query from the original data type present in the table queried to another data type in the table formed by the query. My source table data type is "character" and the resulting table needs to have this field designated as a floating point or double decimal in order for me to build a chart around the data.

Any help would be appreciated. [sig][/sig]
 
Waht's wrong with select blabla, CONVERT(float, char_field), blabla ... ?

Of course you'll run into trouble if the char value is not CONVERTable to float.

If that isn't good enough you might want to get the whole thing into a temporary table and take it from there.

/al [sig][/sig]
 
try this

select blabla, char_field=CONVERT(float, char_field) from ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top