Knowledge Base

How To Calculate a Person's Current Age

Article ID: 124327

Article Last Modified on 12/3/2003


APPLIES TO


This article was previously published under Q124327

SUMMARY

To calculate a person's current age, enter the following commands in the Command window:
   m.DOB = {12/03/62}
   m.age = ROUND(((DATE() - m.DOB) / 365.25),0)
   ? m.age
				
NOTES: The value 365.25 accounts for leap years, and the question mark tells FoxPro to print the age to the screen. You may need to minimize open windows to see the printed value.

Additional query words: VFoxWin FoxWin FoxDos FoxMac birthday birthdate

Keywords: kbcode KB124327