How can I use a 4-digit numeric field to filter records whose date field is formatted as a short date (mm/dd/yyyy)?
On frmRptCriteria there's a data object called txtYear. Users enter a 4-digit year into this field to specify which fiscal year the report is for. If a user enters "2007" into frmRptCriteria.txtYear, I need the report object to use that entry to produce this report data:
1. Number of records entered YTD (2007)
2. Number of records entered in previous year
The report source = tblWARNData;
the corresponding date field in the table = EntryDate.
So for #1 above I added this statement to the report object's control source:
=Sum(Abs([EntryDate]=[Forms]![frmRptCriteria]![txtYear]))
But I know this won't work because [EntryDate] and [txtYear] are not formatted the same.
How can I compare "2007" in [txtYear] to just the YYYY in [EntryDate] so that the stmt counts all records with an EntryDate of 1/1/2007 - 12/31/2007?
For #2 do I need to modify it something like this:
=Sum(Abs([EntryDate]=([Forms]![frmRptCriteria]![txtYear]-1)))
Thanks in advance!
On frmRptCriteria there's a data object called txtYear. Users enter a 4-digit year into this field to specify which fiscal year the report is for. If a user enters "2007" into frmRptCriteria.txtYear, I need the report object to use that entry to produce this report data:
1. Number of records entered YTD (2007)
2. Number of records entered in previous year
The report source = tblWARNData;
the corresponding date field in the table = EntryDate.
So for #1 above I added this statement to the report object's control source:
=Sum(Abs([EntryDate]=[Forms]![frmRptCriteria]![txtYear]))
But I know this won't work because [EntryDate] and [txtYear] are not formatted the same.
How can I compare "2007" in [txtYear] to just the YYYY in [EntryDate] so that the stmt counts all records with an EntryDate of 1/1/2007 - 12/31/2007?
For #2 do I need to modify it something like this:
=Sum(Abs([EntryDate]=([Forms]![frmRptCriteria]![txtYear]-1)))
Thanks in advance!