424,982 Members | 1,939 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

# sort date in sql by DDMMYYYY

 P: 18 hi... i need help on this function...i want to sort data in a table that arrange the data according to the month,date and then year. by using this code below, i am able to sort the data ascending according to date, but, the it follows the first number in the date2 column. for example, 1/2/2012,17/2/2012,2/1/2012.....i want it to be sorted like, 2/1/2012,1/2/2012,17/2/2012...... Expand|Select|Wrap|Line Numbers          Web site                                                             function showDate() {     var now = new Date();     var days = new Array('Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu');     var months = new Array('Januari','Februari','Mac','April','Mei','Jun','Julai','Ogos','September','Oktober','November','Disember');     var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();     function fourdigits(number)     {         return (number < 1000) ? number + 1900 : number;     }       tnow=new Date();     thour=now.getHours();     tmin=now.getMinutes();     tsec=now.getSeconds();       if (tmin<=9) { tmin="0"+tmin; }     if (tsec<=9) { tsec="0"+tsec; }     if (thour<10) { thour="0"+thour; }       today = days[now.getDay()]  +"
"+ date + " " + months[now.getMonth()] + "  "+ (fourdigits(now.getYear())) + "
" + thour + ":" + tmin +":"+ tsec;     document.getElementById("dateDiv").innerHTML = today; } setInterval("showDate()", 1000);

•                       Laman Utama

•                                Visi
•
•                                Misi
•
•                             Piagam Pelanggan
•

•
•                       Profil Saya
•
•                       Maklumat Staf
•
•                       Peta Lokasi
•
•                       Tugas Pegawai
•                             Masukkan Data Baru
•
•                             Carian Data
•
•
• objMY=new Object;objMY.wtsclock="wtsclock001.swf";objMY.color="32CD32";objMY.wtsid="MY";objMY.width=130;objMY.height=130;objMY.wmode="transparent";showClock(objMY);

Perlis

•

TUGAS HARIAN

Nama          :                             Jawatan    :

Tarikh         Tugasan           Catatan                    ";         //echo "";         echo "".\$rGet['date2']."";         echo "".\$rGet['task2']."";         echo "".\$rGet['note2']."";         echo "";     }     //echo "";     ?>                                                                                                                                                                              Home |                Products |                Services |                News |                About

UNIT TEKNOLOGI MAKLUMAT, JABATAN KESIHATAN NEGERI PERLIS
Disclaimer & Copyright | Technical support by : Unit Teknologi Maklumat JKNPs Copyright @ 2011 - 2012 to Unit Teknologi Maklumat JKNPs.

somebody please help me....this is urgent.....tq Feb 22 '12 #1