<div dir="ltr"><div class="gmail_extra"><br /><div class="gmail_quote">On Wed, Feb 19, 2014 at 2:18 PM, AlexK <span
dir="ltr"><<ahref="mailto:alkuzo@gmail.com" target="_blank">alkuzo@gmail.com</a>></span> wrote:<br /><blockquote
class="gmail_quote"style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> The
followingcode gets the job done, but I am wondering if there is a<br /> simpler/cleaner way?<br /><br /> WITH
start_dateAS(SELECT DATE '2014-02-18' AS start_date)<br /> select CAST( to_char(start_date + INTERVAL
'1d'*i,'YYYYMMDD')AS INT) AS<br /> end_range<br /> from generate_series(1,100) AS i CROSS JOIN start_date;<br
/></blockquote></div><br/></div><div class="gmail_extra">You can use the other variation of generate_series to use
datesdirectly:<br /><br /> select to_char(ymd,'YYYYMMDD') ymd from
generate_series('2014-02-18'::date,'2014-03-18'::date,'1day'::interval) ymd;<br /> ymd <br />----------<br
/> 20140218<br/> 20140219<br /> 20140220<br /> 20140221<br /> 20140222<br /> 20140223<br />...<br /></div></div>