portlight
asked on
cast mySQL string to double
I am having to pull a cost from a string....
substr(l.details, instr(l.details , ':' ) +1)AS charge,
This works for doing the calculations correctly, HOWEVER when I to print the value is prints as an 'object' not a string.
I have tried cast and convert....how can i get this above code to print the actual string out
substr(l.details, instr(l.details , ':' ) +1)AS charge,
This works for doing the calculations correctly, HOWEVER when I to print the value is prints as an 'object' not a string.
I have tried cast and convert....how can i get this above code to print the actual string out
ASKER
That gave me an error at the ,
I did cast to a double but it created it as a zero.
The value I am looking to see is .70
I did cast to a double but it created it as a zero.
The value I am looking to see is .70
First make sure the extraction gets you the value out.
Can you post the string from which you want the data extracted?
Can you post the string from which you want the data extracted?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Cast (substr(l.details, instr(l.details , ':' ) +1), varchar(5))
or whatever size you need