On Wed, Feb 19, 2014 at 2:18 PM, AlexK <alkuzo@gmail.com> wrote:
The following code gets the job done, but I am wondering if there is a simpler/cleaner way?
WITH start_date AS(SELECT DATE '2014-02-18' AS start_date) select CAST( to_char(start_date + INTERVAL '1d'*i,'YYYYMMDD') AS INT) AS end_range from generate_series(1,100) AS i CROSS JOIN start_date;
You can use the other variation of generate_series to use dates directly: