Sorting Date/Time in SQL/Oracle DB

Results 1 to 2 of 2

Thread: Sorting Date/Time in SQL/Oracle DB

  1. #1
    Sandi Guest

    Default Sorting Date/Time in SQL/Oracle DB

    strSQL="select A.c_remarks, A.d_updatedate, A.c_updatetime, A.c_updatebyid, A.c_updatebyname, B.c_status, C.c_phase " & _<BR> "from rfsupdates A, phasestatus B, phases C where A.n_rfstrack = " & sqlStr(Session("ActiveRFS")) & " and A.n_status = B.n_id " & _<BR> "and A.n_phase = C.n_id order by A.d_updatedate desc, A.c_updatetime desc"<BR><BR>The code above sorts date correctly, however, in the time sort, AM times are sorted before PM times within the same date. We want to get today&#039s date, 2:03 PM to sort before today&#039s date 7:04 AM. Is this possible and if it is, how?<BR><BR>Thanks<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Sorting Date/Time in SQL/Oracle DB

    I&#039m just a newbie but:<BR>Use the ascending on the c_updatetime field?<BR><BR>A.c_updatetime asc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts