why not just have a lookup table  with the months in it as strings.
Then your code would be:

<cfquery name=ListMonths>
SELECT monthName, monthID
FROM months
</cfquery>


<select name=months selected=1>
<cfoutput query=ListMonths>
<option value=#monthID#>#monthName#</option>
</cfoutput>
</cfselect>

Michael T. Tangorre
--------------------------------------------
Web Applications Developer
Office Phone: 703-558-4746
Cellular Phone: 607-426-9277
AIM: CrazyFlash4
Personal Email: [EMAIL PROTECTED]
Work Email: [EMAIL PROTECTED]
School Email: [EMAIL PROTECTED]
--------------------------------------------
This Email contains MillenniuM Information
Systems, LLC Privileged Information which
is Customer or Business Sensitive.
--------------------------------------------


-----Original Message-----
From: Kwang Suh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 9:59 AM
To: CF-Talk
Subject: RE: Sort by 1st three letters of month?


There is no need to do this in ColdFusion.  Your database is able to convert
the month numbers into their text equivalents.  MUCH faster than doing it in
CF.

-----Original Message-----
From: Guy McDowell [mailto:[EMAIL PROTECTED]]
Sent: August 1, 2001 7:30 AM
To: CF-Talk
Subject: RE: Sort by 1st three letters of month?


What I do is on forms in in the database I just use the numbers 1-12 for
months as the data. Then on output I do somehting like

<cfif month IS 1>January</cfif
<cfif month IS 2>February</cfif>
etc.

It's not the most eloquent way but it works and is highly reusable. That way
I just do an ordinary ORDER BY months, and it works.
Of course this calls for having seperate fields for month, day, date.

Guy
www.guymcdowell.com


>------------------------------
>
>Date: Wed, 01 Aug 2001 00:33:11 -0600
>From: "Kwang Suh" <[EMAIL PROTECTED]>
>Subject: RE: Sort by 1st three letters of month?
>Message-ID: <000101c11a53$d676c440$[EMAIL PROTECTED]>
>
>Cast the text strings to a date within your SQL query.  Then, you can
>easily
>sort by month.
>
>-----Original Message-----
>From: Willy Ray [mailto:[EMAIL PROTECTED]]
>Sent: July 31, 2001 2:23 PM
>To: CF-Talk
>Subject: Sort by 1st three letters of month?
>
>
>Ok, I'm an idiot.  I have my users putting in text strings for months.
>
>I need
>
>Jan. 12
>
>to be ordered ahead of
>
>Aug. 9
>
>These are text records.  Is there any way to do this?  I guess I could
>parse
>out the first three characters of whatever my user entered, run it through
>a
>big cfswitch to assign numerical values to the months, add a leading zero
>to
>the day part...
>
>Is there any easier way?
>
>Willy
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.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

Reply via email to