List:General Discussion« Previous MessageNext Message »
From:Johnny Withers Date:September 29 2010 2:52am
Subject:Re: ORDER BY with field alias issue
View as plain text  
Order by reservation.time

JW

On Tuesday, September 28, 2010, Chris W <4rfvgy7@stripped> 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 format function output with am and pm.
>  I guess I should have named things differently but I would rather not do that.
>  Is there a standard way to get around this and have it sort by the non-formatted
> time value?
>
>
> Chris W
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>

-- 
-----------------------------
Johnny Withers
601.209.4985
johnny@stripped
Thread
ORDER BY with field alias issueChris W29 Sep
  • Re: ORDER BY with field alias issueJohnny Withers29 Sep
  • RE: ORDER BY with field alias issueBMBasal30 Sep
    • RE: ORDER BY with field alias issueDaevid Vincent30 Sep