Retrieving data between two dates in Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sonalpathak
    New Member
    • Feb 2007
    • 4

    Retrieving data between two dates in Access

    hi!
    i ve been using this query in ACCESS n its nt working:
    SELECT * FROM TABLENAME WHERE BDAY BETWEEN '01/01/1980' AND '01/01/2006';
    the error is "Datatype mismatch in criteria expression'.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use:
    Code:
    SELECT * FROM TABLENAME WHERE BDAY BETWEEN #1/1/1980# AND #1/1/2006#

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32663

      #3
      This link (Literal DateTimes and Their Delimiters (#).) may help you understand the situation better (Why Rabbit's solution works).

      Comment

      Working...