How can I fetch data between two date ranges using select query?
For eg I want the records that lie in the month of Oct 2022-Dec 2022. I am using below select query :
select * from [Sheet1$$] where [Date] BETWEEN #10/1/2022# AND #12/31/2022#
the query is giving me records of every year for the months of Oct-Dec instead I want the records for just 3 months (Oct,Nov,Dec) of the year 2022.
P.S. - I am using excel as database
Try with the following query.
You have to cover all possibilities. From Date or To Date could be between your date range or the record dates could cover the whole range.
Maybe you can try some other filters in order to identify what causes the incorrect data.
select * from [Sheet1$$] where [Date] BETWEEN #10/01/2022# AND #12/31/2022#
select * from [Sheet1$$] where [Date] BETWEEN #01/01/2022# AND #12/31/2022#
select * from [Sheet1$$] where [Date] BETWEEN #10/01/2022# AND #10/31/2022#
and the above query provided by