Tuesday, March 24, 2009

Coldfusion Query to List

Well, I was looking for a simple function which could give me the query results in form of a list, I only had one Column Selected

<cfquery name="get_data" datasource="testDsn">
select date from table1

what is was looking for was just I can do <cfset list = QueryToList(get_data.date)> and I found that there is already a coldfusion function "valueList" to do the same. So to get the list from above you can simply do

<cfset list = valueList(get_data.date)>

really helpful.

1 comment:

Anonymous said...

Just wanted you to know that your post helped me. Thank you.