This is my first dbase related assignment. i need to count age by refering to today's date & date of birth of the person. I have a hard time to even call today's date function in dbase. Anyone pls help!!
i've figured it out... yahoo!!
I'm actually counting age in month for babies. the following code is what wrote:
.replace age with (month(date())+(12*year(date())))-(month(childdob)+(12*year(childdob))) for day(date())>=day(childdob)
.replace age with (month(date())+(12*year(date())-1)-(month(childdob)+12*year(childdob)) for day(date())<day(childdob)
anyone can help me to test whether this set of code have any bug? hopefully it's correct, i'm going to test it right away.
Can your version process the IIF() function? If so then you can combine it into one command rather than 2. Harder to read with all those parantheses, but more compact.
Code:
replace age with (month(date())+(12*year(date())-IIF(day(date())<day(childdob),1,0))-(month(childdob)+12*year(childdob))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.