General information
Forum:
Microsoft SQL Server
Hi,
declare @dot datetime, @dt datetime
SET @dot = '03/21/1984'
SET @dt = '03/06/2002'
Select Datediff(Month, @dot, @dt)/12 as age
-- answer of this comand is 18
Select Datediff(Day, @dot, @dt)/365 as age
-- answer of this comand is 17
Look at the date. How do you think how old is man, who's birthday is on @dot. :)
Yours faithfully
Eugenijus
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only