Year Query

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

In a table containing employee information, I have a field
that shows birthdate as MM/DD/YY. How would I write a
query that I could use a parameter box that prompt me for
entering a particular year? An example would be wanting
to see everyone who was born in 1980. Thanks!
 
In a table containing employee information, I have a field
that shows birthdate as MM/DD/YY. How would I write a
query that I could use a parameter box that prompt me for
entering a particular year? An example would be wanting
to see everyone who was born in 1980. Thanks!

Two ways:

- Add a calculated field by typing

BirthYear: Year([birthdate])

in a vacant Field cell, and put a criterion on it of

[Enter year:]

- Or, to take advantage of indexes on the table, use just the
birthdate field with a criterion of
= DateSerial([Enter year:], 1, 1) AND < DateSerial([Enter year:] + 1, 1, 1)
 
Back
Top