SQL - Query range between two dates (NON-VBA)
Posted
by Mohgeroth
on Stack Overflow
See other posts from Stack Overflow
or by Mohgeroth
Published on 2010-04-09T22:02:58Z
Indexed on
2010/04/09
22:13 UTC
Read the original article
Hit count: 186
I see various topics on this around stack overflow but none that fit the contect of MS-Access...
Given a starting date and an ending date, is there a way through SQL to return records for each given month within the time frame?
EG:
Between #1/1/2010# and #12/31/2010#
results #1/4/2010#
#1/11/2010#
.....
#12/27/2010#
Restrictions
- MS-Access 2003 :No Case/Loops inside the SQL (IIF statements are good)
- This is a view only, NO VBA will be used since the data will not be tampered with. Disconnected recordset is my last option. I would prefer to find out theres some way to call your customized functions in the SQL to help return these values... some class stored on a global scope while you iterate through this date range maybe...
Is this possible? I see many no's, but if there was a way to pass a value into a function I could find a way to make this work. Sad that I don't have a way to simulate a stored procedure without using a d/c recordset, at least that I know of... any experts out there know a way?
© Stack Overflow or respective owner