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 bkrike 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]
 
I am not sure what flavor of SQL you are using, but Oracle has a TO_NUMBER() function that converts a string to a number. The format for it is:
Code:
TO_NUMBER(str, fmt VARCHAR2, nlsparms)
where the nlsparms is your decimal character, group separator, and a sysbol for local or international currency.

Hope this helps...
[sig]<p>Terry M. Hoey<br><a href=mailto:th3856@txmail.sbc.com>th3856@txmail.sbc.com</a><br><a href= > </a><br>Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top