SQL for date range in ACCESS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geek491
    New Member
    • Oct 2006
    • 21

    SQL for date range in ACCESS

    I want an SQL that displays all the days within the range given.


    SELECT <days> from <dual> where days between '01/01/2006' and '12/12/2006'

    Dual table is precent in Oracle but what is its equivalent in ACCESS?


    If i run the above query with a different date range i should get all the days between those two date ranges.
  • Tanis
    New Member
    • Mar 2006
    • 143

    #2
    Try this. Change your table and field name.

    Code:
    SELECT YourTable.DateField
    FROM YourTable
    WHERE (((YourTable.DateField) Between #1/1/2006# And #12/12/2006#));

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32668

      #3
      I believe there is no built-in facility to do this (would that there were).
      You can create the data using a For loop in code, but it's messy and you'd have to have somewhere to store it, even if only temporarily.

      Comment

      Working...