Congratulations, you win the prize for longest subject line. :D
I'd trim in the query itself, but if you want to:
<cfquery name="jobapplicants">
<cfscript>
for (i=1; i LTE listlen(jobapplicants.columnlist); i=i+1) {
colName = listgetat(jobapplicants.columnlist, i);
querySetCell(jobapplicants, colName, trim(evaluate(colName)),
jobapplicants.currentrow);
}
</cfscript>
</cfquery>
..something like that, anyway.
Consider doing it in the query, though.
Jamie
On Wed, 10 Jul 2002 10:04:50 -0400, in cf-talk you wrote:
>Hello All:
>
>Issue: Trying to loop through a query and trim all the fields in the
>table before I output them without having to hardcode each field.
>.
>Sincerely,
>James Blaha
>
><CFQUERY NAME="JobApplicants" DATASOURCE="HRWebAgent">
>SELECT *
>FROM dbo.tApply
></CFQUERY>
>
>
> <CFOUTPUT>
> <CFLOOP QUERY="JobApplicants">
>
> <CFSET ValuesPassed = TRIM(#ValuesPassed#)>
> #ValuesPassed#<br>
>
> </CFLOOP>
> </CFOUTPUT>
>
>
>This code works for form fields and I want to do the same for the query
>results.
>
><!--- To output the active variables uncomment --->
> <CFOUTPUT>
> <CFLOOP ITEM="ValuesPassed2" COLLECTION="#FORM#">
> <!--- <CFOUTPUT><strong>Form.#ValuesPassed2#</strong> =
><strong>#Form[ValuesPassed2]#</strong><br></CFOUTPUT> --->
>
> <CFSET ValuesPassed2 = TRIM(#FORM[ValuesPassed2]#)>
> #ValuesPassed2#<br>
>
> </CFLOOP>
> </CFOUTPUT>
>
>
>FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
>Archives: http://www.mail-archive.com/[email protected]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists