Note to using the following all you need to is turn your individual date items into a single string and make the date1 and then using the Now( ) function as date2.
VBA DateDiff Function
The VB DateDiff function returns a variant variable result of subtracting two dates. The unit of measure is defined in the interval argument.
Syntax
DateDiff(interval, date1, date2[, firstdayofweek[
Arguments:
interval - Required. String expression that is the interval of time you use to calculate the difference between date1 and date2. See a list of valid intervals in the DateAdd function above.
date1, date2 - Required; Variant (Date). Two dates you want to use in the calculation.
firstdayofweek - Optional. A constant that specifies the first day of the week. If not specified, Sunday is assumed.
firstweekofyear - Optional. A constant that specifies the first week of the year. If not specified, the first week is assumed to be the week in which January 1 occurs.
Example:
MsgBox DateDiff("yyyy"
Above displays '1'.
Your specific example assumes your items are numeric
strBirthDate = Format(Day_Birth, "00") & "/" & Format(Month_
intAge = DateDiff("yyyy"
--- On Thu, 5/28/09, abdul daulay <abdulhakimdaulay@
>
> I want to make a school database, but I don't know how to get a student age. I have
> three field name=Day_Birth, Month_Birth and Year_Birth. Please help me...
>
[Non-text portions of this message have been removed]
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Nenhum comentário:
Postar um comentário