Programming with Talha Tanweer
Asp.net
Ado.net
C#
Sql
Entity Framework
Articles
Question & answers
Forums
How to
Tuesday, 25 March 2014
Find Age from Date of Birth in Sql Server
declare
@dob
datetime
=
'1952-08-14 21:11:19.300'
select
CAST
(
DATEDIFF
(
Y
,
@dob
,
getdate
()
)/
365.25
as
int
)
-
- 365 are the Number of Average days in 4 years
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment