user2620253
user2620253

Reputation:

Microsoft Access Date Function

I am trying to create a query on a table that filters out dates. I need to display all records previous to a specific date, but need this to be dynamically updated annually.

Specifically, I need to find dates prior to October 1 of the previous year. (i.e. anything prior to Oct 1, 2012.) I know I can use '<#10/1/2012#' but would like to make this dynamic to update every year, as this same function will be utilized for multiple queries.

I have tried several iterations of the Date() function to get this to work, to no avail. Things that don't work are...

Year([TrainingDate])

Upvotes: 1

Views: 144

Answers (1)

Andy G
Andy G

Reputation: 19367

[TrainingDate] < DateSerial(Year(Date())-1,10,1)

Date() is the current date, so Year(Date()) is the current year.

Upvotes: 2

Related Questions