Query question for a form

  • Thread starter Thread starter Lurch
  • Start date Start date
L

Lurch

Hey guys!

I have a query that has a field in a table called "Year". It contains just
the year and has several years going back to the mid 90's.

How do I put a criteria in the query that will filter out everything but the
current year regardless of what year it is. I tried to use the DateSerial
but to no avail.

Any help would be most appreciated. I know this is probably simple but I
just can't seem to get it.

Thanks everyone!!

Tony
 
The criteria would be

=Year(Date())

This will return the year of the current date. However, as you can see,
there may be a problem here. The function name is year and so is your field
name. This may cause a conflict. You shouldn't use reserved words as names.
As a work around, you may get this to work.

=Format(Date(), "yyyy")

Supply the correct number of "Ys" for the number of digits you have in the
year. Hopefully, you're using 4 digit years.
 
Wayne;

That must have been it. I used the name "Year". Something so simple yet
escaped me.

Thanks!!!!

Tony
 
Back
Top