Kris Pilles wrote:

> I need to know how to set variable length on some query results I am
> amending to a text file.  For example the query returns a 7 digit
> student number but I need studentnumber to take up spaces... Is there 
> an easy way where I can add 2 spaces to the end of this query result...
>
> Ideally I would like to set variable x = a length of 9 y = 12 etc...
> This way if student number is returned as a 6 digit string I don't 
> need to do anythign else...


Do this in the database:

<cfset x = 9)
<cfquery ...>
SELECT  Cast(studentnumber AS CHAR(#x#)) AS paddedstudentnumber
FROM    students
WHERE   ......
</cfquery>

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to