Order by Date/Time

Results 1 to 2 of 2

Thread: Order by Date/Time

  1. #1
    Fion Guest

    Default Order by Date/Time

    I&#039m using an Access table and "purchaseDate" is of Date/Time data type. I wish to retrieve and display records sorted by Date using the sql statement below, but it does not seem to work. It seems to give me records that are last accessed follwed by others which are least accessed.<BR><BR>function GetPurchase<BR>dim sql,rs<BR>set rs = Server.CreateObject("ADODB.RecordSet")<BR><BR>sql = "Select o_id as ""Purchase id"",purchaseDate as ""Date Initiated"", p_title as ""Project title"",totalAmt as ""Total Amount"", status as ""Current Status"" from purchase where staff_id = &#039"+user+"&#039 order by purchaseDate"<BR>rs.open sql,dbConn<BR>set GetPurchase = rs<BR>end function<BR><BR>I really need to order the records by the purchaseDate. Please enlighten or advise.<BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Order by Date/Time

    you could try:<BR>"order by purchaseDate desc;"<BR>

Posting Permissions

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