Query Date Range within a date Range

Mick99

New member
Local time
Today, 11:04
Joined
Feb 19, 2016
Messages
14
Hi All,

I have a number of actions with start and finish dates. The issue is that I want to view a certain period within these dates and I cant seem to figure out how to do this. I have a form that allows to user to select the particular week they need to view, however the query only returns records that have dates in the range and don't allow for targeting dates in the range inside the range, if that makes sense.
 
Hi. Have you tried maybe something like this? Just curious...
Code:
...WHERE StartDateField<=[RangeEnd] And EndDateField>=[RangeStart]
(untested)
 
Last edited:
No I havn't would that work in a query, I'll give it a go.

Cheers Mick
 
you need to use the Form's control on your Query:

select * from yourTable Where dateField between [Forms]![yourFormName]![startDateControl] And [Forms]![yourFormName]![endDateControl]
 
Hi [U]theDBguy[/U] , this seems to have done the trick. Thankyou!!! :)

RESULTS_FILTER: [WP_Activity_Start]<[Forms]![frm_Report_Selection]![Week_End] And [WP_Activity_Finish]>[Forms]![frm_Report_Selection]![Week_Start]
 
Hi [U]theDBguy[/U] , this seems to have done the trick. Thankyou!!! :)

RESULTS_FILTER: [WP_Activity_Start]<[Forms]![frm_Report_Selection]![Week_End] And [WP_Activity_Finish]>[Forms]![frm_Report_Selection]![Week_Start]
Oh, was it a false alarm then? Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom