-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
* and then Victoria Reznichenko declared.... > NW> and here is my select: > > NW> $qry="SELECT id, module, week, "; > NW> $qry.="DATE_FORMAT(date, \"%d %m %Y\") as date, "; > ^^^^^^^^^^^^^^^^ > The result of DATE_FORMAT() function is a string. So, in ORDER BY > clause is used string 'date'. That is why you get "wrong" sorting. Use > another alias for your date column, it should help you, i.e.: Yes! How strange, the penny dropped whilst I was making a cup of tea and I was sure I had it. Now I /know/ I do. Many thanks Victoria :-) sql - -- Nick Wilson // www.explodingnet.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE81+GXHpvrrTa6L5oRAuMXAJ0clmtEYrYscsNlNgCktrN5AlPDfwCffgWS bfCr8rkBNl4YwtNo7TAbbWY= =/rKf -----END PGP SIGNATURE----- --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php