on 12-05-2013 6:44 AM
Hey Guys,
I have an object in the Universe Design Tool 4.0 which has "Character" data type. I need to convert it into a measure/number. The database is MySQL. Can anyone tell me the formula to convert it? Thanks.
Try with the SQL below and update if you face any issues
To separate text and number from string like USA-200 use the below query
SELECT field,CONVERT(SUBSTRING_INDEX(field,'-',-1),UNSIGNED INTEGER) AS num
FROM table
Just to convert a numeric fields stored in number use
SELECT field,CONVERT(field,UNSIGNED INTEGER) AS Number
FROM table
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use either CAST or Convert to change the datatypes.
CAST(field as INT)
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.