I'm trying to open a report that displays all the records that are active during the user selected start and stop dates. I’m having trouble with the syntax since there are two input dates and two database dates to compare.
If they select 1 Apr 04 – 30 Apr 04 I want to see record 1.
If they select 1 May 04 – 30 May 04 I want to see record 1 and 2
Record 1
Start Date 12 Apr 04
Stop Date 30 Sep 07
Record 2
Start Date 15 May 04
End Date 15 July 05
Here's what I tried to use. It works if you select 1 Apr 04 - 30 Apr 04 but doesn't work if you select 1 May 04 - 30 May 04
Expand|Select|Wrap|Line Numbers
- DoCmd.OpenReport stDocName, acViewPreview, , (startdate & " between " & Me.txtStartDate & " and " & Me.txtStopDate & " Or " & stopdate & " between " & Me.txtStartDate & " and " & Me.txtStopDate & " Or " & Me.txtStartDate & " between " & startdate & " and " & stopdate & " Or " & Me.txtStopDate & " between " & startdate & " and " & stopdate)