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
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to