Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

dates birth

ResolvedVersion 7

Sheila has attended:
Access Intermediate course

Dates of Birth

We have got details of people's dates of birth but would like Access to tell us their ages automatically.

RE: Dates of Birth

Hi Sheila - apologies for the delay. I have a couple of suggestions for a calculated field in a query. Should have them online by end of today.

Kind regards,
Andrew

RE: Dates of Birth

Hi Shirley

Make a query based on the table containing the DOB field. Create a custom field in the query by adding the following to the field row:

Age: DateDiff("yyyy",[DOB],Now())+Int(Format(Now(),"mmdd")<Format([DOB],"mmdd"))

This uses the datediff function to work out the difference between your DOB field and today's date. You should find your query now has a new column called Age with the calculated value.

There are several ways of approaching this but this might just do the trick. Give it a try and see if the results work with your data.
Kind regards,
Andrew

Fri 11 Sep 2009: Automatically marked as resolved.

Access tip:

Create own ribbon tab - Access 2010

a. In Access click on the File tab
b. Select Options from left hand side
c. Choose the Customize Ribbon section
d. Click the New Tab button (below the list of tabs on the right hand side of the dialog box)
e. Select the New Tab (Custom) and enter a name, by clicking the Rename button (below the list of tabs on the right hand side of the dialog box)
f. Select the New Group (Custom) and enter a name, by clicking the Rename button (below the list of tabs on the right hand side of the dialog box)
g. Add commands to your tab and group by locating them on the list on the right hand side (remembering that you can change the list using the drop down box at the top of the list of commands) and clicking the Add button between the two panes to add them to your tab and group
h. You can rearrange the commands in your group, the groups on any tab or the tabs, using the up and down arrow buttons beside the list of tabs.
i. Click OK to apply your changes

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.