By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,825 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,825 IT Pros & Developers. It's quick & easy.

SQL for date range in ACCESS

P: 21
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.
Dec 4 '06 #1
Share this Question
Share on Google+
2 Replies

P: 143
Try this. Change your table and field name.

Expand|Select|Wrap|Line Numbers
  1. SELECT YourTable.DateField
  2. FROM YourTable
  3. WHERE (((YourTable.DateField) Between #1/1/2006# And #12/12/2006#));
Dec 4 '06 #2

Expert Mod 15k+
P: 31,662
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.
Dec 4 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.