tblActionSheetNote.acsDate is a Date Time field so I am converting it to just Date.
The idea of this filter is that, if the acsDate is more than 30 days older than the report date, the record is to be returned.
The problem is, when I run the query with a report date of 1 March 2016, it returns 1115 records with date ranges from 20/10/2010 to 19/01/2016. This sounds correct....
until I change the formula from Less Than to Greater Than (eg (Date({tblActionSheetNote.acsDate})>{?Pm-@DateRange}-30)
Now it returns only 129 records, BUT the date range for those records are 20/05/2010 to 19/01/2016???
If I run a query asking if it is less than a date, then I run the same query asking if it is greater than the date, why would it be returning records with the same date ranges?
Is there another (better) way I can check to see if one date is before or after another date?
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 04 Feb 2016 at 2:33am
1. the date range of the results is displaying the date value from tblActionSheetNote.acsDate, correct?
2. place the ?Pm-@DateRange parameter field into the sub-report header to verify the value that was passed to it
3. try using the DATEADD() on it rather than -30
Date({tblActionSheetNote.acsDate})>DATEADD('d',-30,{?Pm-@DateRange})
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum