Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Age to Years,Month,Day - Problem With
Message
From
10/09/2002 18:53:52
 
 
To
10/09/2002 17:35:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00699014
Message ID:
00699114
Views:
17
Kirk:

The last code I send you had an error. You must replace this 3 lines:

nHowManyYears = IIF(nCurMonth > nBirthMonth, nCurYear - nBirthYear, (nCurYear - nBirthYear) -1)
nHowManyMonths = IIF(nCurMonth > nBirthMonth, nCurMonth-nBirthMonth, (12-nBirthMonth) + nCurMonth)
nHowManyDays = IIF(nCurDay > nBirthDay , nCurDay-nBirthDay , (nDaysInMonth-nBirthDay)+nCurDay)

with this:

IF nCurDay => nBirthDay
nHowManyDays = nCurDay-nBirthDay
IF nCurMonth => nBirthMonth
nHowManyMonths = nCurMonth-nBirthMonth
nHowManyYears = nCurYear - nBirthYear
ELSE
nHowManyMonths = (12-nBirthMonth) + nCurMonth
nHowManyYears = (nCurYear - nBirthYear) -1
ENDIF
ELSE
nHowManyDays = (nDaysInMonth-nBirthDay)+nCurDay
nHowManyMonths = IIF(nCurMonth > nBirthMonth, nCurMonth-nBirthMonth-1, (12-nBirthMonth) + nCurMonth - 1)
nHowManyYears = IIF(nHowManyMonths = 0, nCurYear - nBirthYear, nCurYear - nBirthYear - 1)
ENDIF


Sorry

mandy
Previous
Reply
Map
View

Click here to load this message in the networking platform