Results 1 to 2 of 2

Thread: select records within a data range

  1. #1
    Join Date
    Jul 2006
    Posts
    11

    select records within a data range

    Using MS Access as database.

    Need to select records within a date range.
    Dates in date field as 1/20/2005, 1/25/2005, 2/15/2005, 3/27/2005, 6/26/2005, etc........

    I tested the BETWEEN operator, but no records were selected. Also tested using " >= and <= ", thus no results.

    ex.:
    SELECT account_recs, account_date, account_exp
    FROM accountold
    WHERE account_date between 282005 and 512005 ;

    SELECT account_recs, account_date, account_exp
    FROM accountold
    WHERE account_date >= 282005 and <= 512005 ;

    Appreciate your replies. Thank you.

  2. #2
    Join Date
    May 2006
    Posts
    407
    You need to format you dates like: #2/8/2005# and #5/1/2005#.
    In other words, you need the pound-sign "#" and slashes "/" so Access has a clue what you are talking about. 282005 and 512005 are just numbers to Access, not dates.

Posting Permissions

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