Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calcluating Age in a query 1

Status
Not open for further replies.

gRegulator

Technical User
Jul 3, 2003
133
CA
Hi,

How would I go about calculating length of time in a query. For example. I have a table called tbl_main, with field 'Date of Birth". How would I be able to use a query to calculate how old a person is? Thanks for any help!
 
Quick and dirty, in the query grid:
Age: (Date()-[Date of Birth])\365.25

Or:
Age: Int((Date()-[Date of Birth])/365.25)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks so much for your fast and useful response. Worked like a charm!

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top