not exactly sure but can't you convert the date into a Julian date and then
divide 7. so can't the day of the week can be obtained from the remainder of
the division of the Julian date by 7.

http://aa.usno.navy.mil/data/docs/JulianDate.html
<http://aa.usno.navy.mil/data/docs/JulianDate.html>

-----Original Message-----
From: Rick Faircloth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 3:39 PM
To: CF-Talk
Subject: RE: How to order by days of the week, but not alphabetically in
this query

Thanks for the reply, Tony.

I was hoping to avoid another column.

Is there any way in MySQL to convert the name of the weekday
to a numeric value for ordering?

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