Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6752695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:04:30+00:00 2026-05-26T13:04:30+00:00

I am trying to create a series of dates from a fixed date in

  • 0

I am trying to create a series of dates from a fixed date in past to current date, in month increments. I know this is possible in 8.4 with a new feature but i am stuck with 8.3 for now.

I feel I am going down a rabbit hole here as I have this sql to get me monthly increments

SELECT  date('2008-01-01') + (to_char(a,'99')||' month')::interval as date FROM generate_series(0,20) as a;

I am then trying to extract months and years from the interval of current date – fixed date

SELECT extract(   month from interval (age(current_date, date('2008-01-01')))     );

but im beginning to think this is a silly way to get the desired date series.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:04:30+00:00Added an answer on May 26, 2026 at 1:04 pm

    Could work like this:

    SELECT ('2008-01-01 0:0'::timestamp
           + interval '1 month' * generate_series(0, months))::date
    FROM   (
       SELECT (extract(year from intv) * 12
              + extract(month from intv))::int4 AS months
       FROM   (SELECT age(now(), '2008-01-01 0:0'::timestamp) as intv) x
       ) y
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to generate a series of monthly dates from a starting date, which
I'm trying to create a series of DIVs that become fixed at certain points
I am trying to create a series of UserControls that all inherit from a
I'm trying to create a series of bound columns in a RadGridView, and I'm
I am trying to create a gradient fill for a series in an area
I am trying to create a menu which is a series of floated li
I'm trying to create a loop that creates a series of objects that contains
I'm trying to create a <div> with a series of photos which are horizontally
I'm trying create a template with django but when I execute this sentences in
I am trying to shift the dates of a series of files by 9

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.