Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    77

    Unanswered: Sql please help !!

    For example, This is the table name microprice in Microsoft Access.

    dat price
    8/23/2004 11
    8/24/2004 28
    8/25/2004 13
    8/26/2004 24
    8/27/2004 56
    8/28/2004 12
    8/29/2004 32
    8/30/2004 21

    I want to show the last five price not include the date of today. Assume today is 8/30/2004

    I want to write the sql that show
    8/25/2004 13
    8/26/2004 24
    8/27/2004 56
    8/28/2004 12
    8/29/2004 32

    So how can I write SQl. I try to use
    sql="select top 5 * from microprice where dat <> '%"&date()&"%' order by dat desc"

    But it doesn't work !!!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    please don't cross-post

    see http://www.dbforums.com/t1009057.html
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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