RE: ORDER BY with field alias issue

2010-09-29 Thread Daevid Vincent
select DATE_FORMAT(`Time`, '%h:%i%p') as `Time`, `time` as > `timex`" > Then, you could use `timex` in your order clause. This works, > but with extra > output, not elegant. > > -Original Message- > From: Chris W [mailto:4rfv...@cox.net] > S

RE: ORDER BY with field alias issue

2010-09-29 Thread BMBasal
clause. This works, but with extra output, not elegant. -Original Message- From: Chris W [mailto:4rfv...@cox.net] Sent: Tuesday, September 28, 2010 8:10 PM To: MYSQL General List Subject: ORDER BY with field alias issue I have the following query that is giving me problems. SELECT DAT

Re: ORDER BY with field alias issue

2010-09-28 Thread Johnny Withers
Order by reservation.time JW On Tuesday, September 28, 2010, Chris W <4rfv...@cox.net> wrote: >  I have the following query that is giving me problems. > > SELECT DATE_FORMAT(`Time`, '%h:%i%p') as `Time` > FROM `reservation` > ORDER BY `Time` > > Problem is it sorts wrong because of the date form

ORDER BY with field alias issue

2010-09-28 Thread Chris W
I have the following query that is giving me problems. SELECT DATE_FORMAT(`Time`, '%h:%i%p') as `Time` FROM `reservation` ORDER BY `Time` Problem is it sorts wrong because of the date format function output with am and pm. I guess I should have named things differently but I would rather not