Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Return age from date passed in
Author:
GP Software Solutions
E-mail:
Click to e-mail author
Submitted:
6/2/2004
Version:
VB3
Compatibility:
VB3, VB4, VB5, VB6
Category:
Date/Time
Views:
16871
Return someone's age by passing in their date of birth.
Declarations:
Usage: ClientAge = ReturnAge("26/11/1978")
Code:
Function ReturnAge(varDOB As Variant) As String 'Check date passed in If IsDate(varDOB) Then 'Calculate the age ReturnAge = DateDiff("yyyy", [varDOB], Now()) + Int(Format(Now(), "mmdd") < Format([varDOB], "mmdd")) End If End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement