I have a recordset that gets numbers from a text. Is there anyway I put this data into an array and change the data type from text to number.
Sojovi - 30 Mar 2006 17:48 GMT
You can use ValueList, returns a comma-separated list of the values of each
record returned from a previously executed query.
ValueList(query.column,delimiter)
And then ListToArray(list, delimiter). About conversion.. in CF is not
necesary, but you have Val(string), that returns a number that the beginning of
a string can be converted to. Returns 0 if conversion is not possible
Regards
Sojovi - 30 Mar 2006 17:49 GMT
You can use ValueList, returns a comma-separated list of the values of each
record returned from a previously executed query.
ValueList(query.column,delimiter)
And then ListToArray(list, delimiter). About conversion.. in CF is not
necesary, but you have Val(string), that returns a number that the beginning of
a string can be converted to. Returns 0 if conversion is not possible
Regards
Dan Bracuk - 30 Mar 2006 18:33 GMT
You could also do nothing. That field of your query is an array.
Sojovi - 30 Mar 2006 19:34 GMT
Yes, Dan is rigth. You can handle a query column as an array.
Regards
Not Nick - 31 Mar 2006 04:59 GMT
CF variables are casted that way, they are all variants. If you need to use the number in a javafunction you will need to use javacast, otherwise: If it looks like a number it IS a number :)
Dan Bracuk - 31 Mar 2006 05:03 GMT
Originally posted by: Frec
Yes, but I need a way to convert that data to a number. So a sum function will work.
What will you be converting it from?