From: Johnny Withers Date: September 29 2010 2:52am Subject: Re: ORDER BY with field alias issue List-Archive: http://lists.mysql.com/mysql/223172 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Order by reservation.time JW On Tuesday, September 28, 2010, Chris W <4rfvgy7@stripped> wrote: > =A0I 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. =A0I guess I should have named things differently but I would r= ather not do that. =A0Is there a standard way to get around this and have i= t sort by the non-formatted time value? > > > Chris W > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Djohnny@pixela= ted.net > > --=20 ----------------------------- Johnny Withers 601.209.4985 johnny@stripped