Hi Andrew
to get the age of a student you need to go to the query object section of
the database container - and then choose Create Query in Design View
now add your table and then click on Close
now double click on the student's name field(s) and they will go down the
bottom of the query grid
now double click on the student's date of birth field
now in the column next to the student's date of birth field type
Age: (Now()-[dob])/365
where [dob] is the name of the field that you've stored the student's
birthdate in (you need the brackets if there are spaces in the field
names) - this will give you the age to a large number of decimal places, it
can be modified to no decimal places by using
Age: Int((Now()-[dob])/365)
once you've typed this in press the red exclaimation mark to see the results
of your query.
These results can then form the basis of a report or can be printed from the
query window.
Please note - when you are in the query results window 9 times out of 10 the
data is "live" - this means if you delete it here you will delete it from
your table. So if you only wanted the ages of the girls and not the boys to
be displayed (for example) then modify your query to only show the girls,
rather than deleting the boys.
Another thing - you said that your database only has one table at the moment
... i would, if i was going to use Access instead of Excel - focus on what
you need in your other tables before you get too far down the query / forms
& reports road as you will possibly have to change these when you sort out
the table structure. With Access (IMHO) everything really needs to start
with getting the tables right first.
Hope this helps
Regards
JulieD
Andrew and Mayra said:
Hi, i create a table with inf. of students of special education. some of
the fields are dates. How to obtain the age of a student base on the date of
birth. I type in the field? Example: 12-sep-1985 (years). My wife and I work
for department of education in PR and need a database for a lot of student
in our school and this subject its critical. Please any help welcome. we
are new in access. I only have the first table. Whats next?