SQL Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rsrinivasan
    New Member
    • Mar 2007
    • 221

    SQL Query

    Hi All,

    I need a query which will sort the date.
    The Date Format is "mm/dd/yyyy hh:ss Am/Pm".

    please help me...
  • chandu031
    Recognized Expert New Member
    • Mar 2007
    • 77

    #2
    Originally posted by rsrinivasan
    Hi All,

    I need a query which will sort the date.
    The Date Format is "mm/dd/yyyy hh:ss Am/Pm".

    please help me...
    Hi,

    Assuming that all your dates belong to a field in a table , you can use a simple ORDER BY Clause in the SELECT statement to Sort the dates.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Use ORDERBY clause on that date field .
      U will get the deired output.

      Comment

      • rsrinivasan
        New Member
        • Mar 2007
        • 221

        #4
        Originally posted by chandu031
        Hi,

        Assuming that all your dates belong to a field in a table , you can use a simple ORDER BY Clause in the SELECT statement to Sort the dates.
        hi,

        thanks for your reply..
        i stored date in one field as date(mm/dd/yyyy) datatype and time(hh:mm Am/Pm) as varchar2 datatype in another field.
        i have to concat the two fields and then sort that field.

        Comment

        Working...