Filter a query with a DateSerial calculation field

tsbergeron

New member
Local time
Today, 03:41
Joined
Nov 21, 2014
Messages
2
I have a query with a DateSerial Calculation field that I would like to filter the query by. The DateSerial calculates the same day of every year (5/31/"YYYY"). When I try to add a criteria sort to this field, I get a data mismatch error.
Here is the code: ThirdMay: DateSerial(Year(DateAdd("yyyy",3,[LastDayYear])),5,31).

How do I get only dates due in 2015 to show? I have tried all the standard date criteria to no avail.

Thanks,
 
How do I get only dates due in 2015 to show?

The way I would apply criteria is to a new, different field based on [LastDayYear] field:

ThirdMayYear: Year([LastDayYear]) + 3

Then apply the criteria underneath that. No need to do unnecessary calculations.

As to the mismatch error, my guess is you have null/non-date values in [LastDayYear].
 

Users who are viewing this thread

Back
Top Bottom