> I saw that, Rob, and held out hope that it might work, but, as you quoted...
>
> "Formats the date value"
>
> it requires a date value...this is just a string...Monday, Tuesday, etc.

:-( - bogus

>
> Is there a way to use this that I'm missing?
>
> >   <CFQUERY Name="GetDays" Datasource="#DSN#">
> >
> >        Select WS_WeekDay
> >          from weeklyschedule
> >      group by WS_WeekDay
> >      order by WS_WeekDay
> >
> >   </CFQUERY>
>
maybe...

      Select
          WS_WeekDay
      from weeklyschedule
      order by  FIND_IN_SET(WS_WeekDay,'sunday,monday,tuesday,wende...');

or...
      Select
          WS_WeekDay,
FIND_IN_SET(WS_WeekDay,'sunday,monday,tuesday,wende...') as daynum
      from weeklyschedule
      order by daynum

those are guesses tho ... sorry I misunderstood your problem. I also
dont have access to mysql today so I cant test. So I'll hush up.

>
> Rick
>
>   -----Original Message-----
>   From: Rob [mailto:[EMAIL PROTECTED]
>   Sent: Wednesday, February 25, 2004 4:27 PM
>   To: CF-Talk
>   Subject: RE: How to order by days of the week, but not alphabetically in
> this query
>
>
>   > Is there any way in MySQL to convert the name of the weekday to a
> numeric
>   > value for ordering?
>
>
> http://www.mysql.com/documentation/mysql/bychapter/manual_Functions.html#Dat
> e_and_time_functions
>
>   DATE_FORMAT(date,format)
>           Formats the date value according to the format string. The
>           following specifiers may be used in the format string:
>
>   %w  Day of the week (0=Sunday..6=Saturday)
>
>   >
>   > If not, I guess I should have just used numeric values in the db instead
> of
>   > names...
>   >
>   > Rick
>   >
>   >   -----Original Message-----
>   >   From: Tony Weeg [mailto:[EMAIL PROTECTED]
>   >   Sent: Wednesday, February 25, 2004 3:27 PM
>   >   To: CF-Talk
>   >   Subject: RE: How to order by days of the week, but not alphabetically
> in
>   > this query
>   >
>   >
>   >   maybe give another column that is day of week...
>   >   so that all wendesdays have day (4) (assuming starting Sunday)?
>   >
>   >   tony
>   >
>   >   -----Original Message-----
>   >   From: Rick Faircloth [mailto:[EMAIL PROTECTED]
>   >   Sent: Wednesday, February 25, 2004 3:21 PM
>   >   To: CF-Talk
>   >   Subject: How to order by days of the week, but not alphabetically in
> this
>   >   query
>   >
>   >   Hi, all...
>   >
>   >   How do I get this query to order by days of the week according to the
>   >   calendar, not alphabetically?
>   >
>   >   <CFQUERY Name="GetDays" Datasource="#DSN#">
>   >
>   >        Select WS_WeekDay
>   >          from weeklyschedule
>   >      group by WS_WeekDay
>   >      order by WS_WeekDay
>   >
>   >   </CFQUERY>
>   >
>   >   I tried order by DayofWeek(WS_WeekDay) as a guess, but that didn't
> work...
>   >
>   >   Rick
>   >
>   >   --
>   >   Outgoing mail is certified Virus Free.
>   >   Checked by AVG Anti-Virus (http://www.grisoft.com).
>   >   Version: 7.0.224 / Virus Database: 261.9.8 - Release Date: 2/24/2004
>   >
>   >
>   >
>   >
>   >
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to