hi all
i need code for age calculate
please if any body have it mail to me
thenk you
[email protected]
Printable View
hi all
i need code for age calculate
please if any body have it mail to me
thenk you
[email protected]
Theres a function that you can use, I'm pretty sure
it'll help you alot. Use DateDiff. Heres some parts
from a VB Help file:
Syntax
DateDiff( interval, date1, date2[/i] )
Remarks
The DateDiff function uses the following parts:
Part Description
interval String expression that is the interval of
time you use to calculate the difference
between date1 and date2.
date1, date2 Two dates you want to use in the
calculation.
You can use the DateDiff function to determine how many specified time intervals exist between two dates. For example, you might use DateDiff to calculate the number of days between two dates or the number of weeks between today and the end of the year.
The following table lists the valid time periods and their interval values. These intervals are also used by the Format function.
Year yyyy
Quarter q
Month m
Day of Year y
Day d
Weekday w
Week ww
Hour h
Minute n
Second s
[Edited by Matthew Howle on 04-29-2000 at 03:13 PM]Code:Sub Command1_Click ()
Label1.Caption = "Days from today: " & DateDiff("d", Now, Text1.Text)
End Sub