If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Age of a group for a fix day
How to calculate the age of the persons of a group for a precise day?
Example: what age do each one will have on July 1st 2008? Thank you |
#2
|
|||
|
|||
Age of a group for a fix day
On Sun, 11 May 2008 12:14:19 -0400, Telesphore wrote:
How to calculate the age of the persons of a group for a precise day? Example: what age do each one will have on July 1st 2008? Thank you Specifically July 1st 2008? In a query: Age: DateDiff("yyyy", [DOB], #7/1/2008#) - IIF(Format([DOB], "mmdd") Format(#7/1/2008#, "mmdd"), 1, 0) Directly as the control source of an unbound control: =DateDiff("yyyy",[DOB],#7/1/2008#)-IIf(Format([DOB], "mmdd")Format(#7/1/2008#,"mmdd"),1,0) Where [DOB] is the birthdate field. OK that's for July 1, 2008. Now what do you do in 2009, 2010, etc.? Change #7/1/2008# to DateSerial(Year(Date()),07,01) to have the value re-computed each January without user intervention. You do know, I hope, that this Age computation should NOT be stored in any table. Just compute it and display it on a form or report, as needed. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|