|
-
Apr 29th, 2000, 01:57 AM
#1
hi all
i need code for age calculate
please if any body have it mail to me
thenk you
[email protected]
-
Apr 29th, 2000, 02:12 AM
#2
Member
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
Code:
Sub Command1_Click ()
Label1.Caption = "Days from today: " & DateDiff("d", Now, Text1.Text)
End Sub
[Edited by Matthew Howle on 04-29-2000 at 03:13 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|