Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to calculate the age from date of birth in python

SELECT DATEDIFF (
	year, DOB, getdate()) + CASE 
      WHEN (DATEADD(year,DATEDIFF(year, DOB, getdate()) , DOB) > getdate())
      THEN - 1 
      ELSE 0
END
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #calculate #age #date #birth #python
ADD COMMENT
Topic
Name
4+8 =