I have a query in which I need to specify a date range. At this time, I manually place in the range with a between statement. What I would like to do is store the date range in a table and have the query run off of that range but when I do, the query takes hours to run. When I manually put it in, about 5 minutes.
I have one table, that's an ODBC connection and another table 'Date Range Input' with the date info with a start and end date field. The ODBC table has one date field, "FILL DATE". In the query under the FILL DATE criteria I have:
Between [Date Range Input.StartDate] And DateAdd("s",-1,CDate(Int(CDbl(DateAdd('d',1,[Date Range Input.EndDate])))))
When I use this, it takes forever!!! Why the big difference in timing from manual to lookup?
Is there an easier/faster way. Any assistance would be great!
I have one table, that's an ODBC connection and another table 'Date Range Input' with the date info with a start and end date field. The ODBC table has one date field, "FILL DATE". In the query under the FILL DATE criteria I have:
Between [Date Range Input.StartDate] And DateAdd("s",-1,CDate(Int(CDbl(DateAdd('d',1,[Date Range Input.EndDate])))))
When I use this, it takes forever!!! Why the big difference in timing from manual to lookup?
Is there an easier/faster way. Any assistance would be great!