database query
Posted: Mon Apr 18, 2005 10:12 am
Hi all,
I have a varchar field which stores dates like "22/05/2004" UK format. When i asc or desc the order, the order i choose to display is not correct. How can i make the order display correct in the query.
This my query. I want the data to order by date using "Y-m-d" format from this field.
I have a varchar field which stores dates like "22/05/2004" UK format. When i asc or desc the order, the order i choose to display is not correct. How can i make the order display correct in the query.
This my query. I want the data to order by date using "Y-m-d" format from this field.
Code: Select all
<?php
select * from studentsexp,tbl_school,tbl_location where studentsexp.SCHOOL_CODE = tbl_school.sc_code and tbl_location.lid = tbl_school.frn_lid and tbl_location.frn_cid = $frn_cid order by studentsexp.SCHOOL_CODE,studentsexp.DOB_DD_MM_ desc
?>