Date Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am having a real problem with birthday queries. Just started using access
a week ago.

1. List all your contacts who have birthdays in December or are over 30
years old.
2. All people who you have birthday data sorted by last name.
3. Use Access to provide the SUM of individuals on the list.
4. Group birthdays by month
 
Have you tried Help? You may need to open a module and press F1 to find help
on Date Functions like Month(). "Sum of individuals" probably is a Count in
a group by/totals query.
 
If you use the help function in the access and lookup queries, there are some
pretty good basic examples. Hope this is helpful.
 
I actually got a response from one of the people at the google group.

A Date/Time value is actually stored as a number - a count of days and
fractions of a day (times) since midnight, December 30, 1899. It's not
a string, so a criterion of 12 would find only people born on January
10, 1900.


Try putting two calculated fields in the query by typing the following
in two vacant Field cells in the query:


BirthMonth: Month([DOB])


assuming that your date of birth field is named DOB. This will contain
values 1 through 12 for the month.


Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)
 
Back
Top