Order by Date does not work..

Results 1 to 2 of 2

Thread: Order by Date does not work..

  1. #1
    Fion Guest

    Default Order by Date does not work..

    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 does not work..

    Try changing the ORDER BY clause to refer to the column by the alais you&#039ve defined in the SELECT clause - ie ORDER BY [Date Initiated].<BR><BR>I&#039m not sure that that&#039s it, but it&#039s worth a try<BR><BR>HTH<BR><BR>Dunc

Posting Permissions

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