Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

postgres get number of days between two dates

SELECT
  AGE('2012-03-05', '2010-04-01'),
  DATE_PART('year', AGE('2012-03-05', '2010-04-01')) AS years,
  DATE_PART('month', AGE('2012-03-05', '2010-04-01')) AS months,
  DATE_PART('day', AGE('2012-03-05', '2010-04-01')) AS days;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #postgres #number #days #dates
ADD COMMENT
Topic
Name
8+5 =