1988-10-20
10 and age of(1988-10-20)
SELECT (DATEDIFF(MONTH,'1988-10-20',getdate()))-(DATEDIFF(YEAR,'1988-10-20',GETDATE())*12) AS Smonth
DECLARE @DOB Date='07/03/1993'; SELECT CAST(ROUND((DATEDIFF(DAY,@DOB,GETDATE())/365.0),0) AS INT) AS AGE OUTPUT:- ---- AGE ---- 25
select convert(nvarchar(max),Month('1988-10-20'))+' and ' + convert(nvarchar(max), DATEDIFF(year, '1988-10-20',getdate()))+' age of '+'1988-10-20' as Age
Declare @DOB datetime='1988-10-20' select Month(@DOB) [Month]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)