Date and filling issues - Mailing list pgsql-sql

From Christopher Crews
Subject Date and filling issues
Date
Msg-id 687096.56737.qm@web52202.mail.re2.yahoo.com
Whole thread Raw
Responses Re: Date and filling issues  ("Osvaldo Kussama" <osvaldo.kussama@gmail.com>)
Re: Date and filling issues  ("Rodrigo E. De León Plicet" <rdeleonp@gmail.com>)
Re: Date and filling issues  (chester c young <chestercyoung@yahoo.com>)
List pgsql-sql
Hi All,<br />I'm not quite sure how to phrase this, but essentially my company has me working on some reports and I
havesome charts associated with the SQL results. <br /><br />My current query is:<br /><br />select <br />   
transaction_dateas date, <br />    sum(sale_amount) as sales<br />from ej_transaction<br /> where transaction_date <br
/>betweencurrent_date - Interval '1 month' and current_date<br />group by transaction_date <br />order by
transaction_dateasc<br /><br />The issue I'm having is that there are some dates where sales of certain items simply
don'ttake place. Instead of putting a date entry in the database with a sale amount of 0, there simply is no entry for
thatdate. I need to make a query that will fill in the dates not found within the date range and populate them with the
salesvalue of 0.<br /><br />A sample of the current results data would be like<br />date                    sales<br
/>2008-03-07        100.00<br />2007-03-10         150.00<br />2007-03-18         50.00<br /><br />and what I'm trying
todo is fill in the missing dates with sales values of 0.<br /><br />Thanks,<br />-CC<br /><br /><p><hr size="1"
/>Nevermiss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your
homepage.</a>

pgsql-sql by date:

Previous
From: "Dean Gibson (DB Administrator)"
Date:
Subject: Re: compare 2 tables in sql
Next
From: "Jonah H. Harris"
Date:
Subject: Re: compare 2 tables in sql