Topic: Show non-sales Posted: 25 Nov 2014 at 4:45am
I have 2 tables, table 1 "Stores" and table 2 "Invoices"
My report will show the stores and invoice totals for the previous day, however if there are no sales on any specific store, no data is showing on the report and I would prefer to show the store and a zero value.
I have tried a left outer join from stores to invoices but still not showing.
In my select record my only filter is invoice date = yesterday
example
store number Total
store 1 100
store 2 0
Store 3 500
Instead I am getting the following
Store 1 100
Store 3 500
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 25 Nov 2014 at 4:49am
you likely have a select criteria of sales.date=yesterday which essentially turns your outer join into an inner join for any store that ever had a sale.
Best solution is to use a command or stored proc and move t that select criteria onto the left join and off the WHERE.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum