![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I everybody i need help to done a simple query that doesn't work. So i have a table where there are days of sale for many stores. Sometime in year some of those stores are closed cause of holyday. But in my query i want a row to show me 0 sales. I tried outers joins on a time table contaning all dates of my month, but none of these 3 joins (right, left ,full) works. I'm working on this since 1 day and i'm now in a dead end. Does someone got this prob before or have a idea to solve this prob. |
#3
| |||
| |||
|
|
I everybody i need help to done a simple query that doesn't work. So i have a table where there are days of sale for many stores. Sometime in year some of those stores are closed cause of holyday. But in my query i want a row to show me 0 sales. I tried outers joins on a time table contaning all dates of my month, but none of these 3 joins (right, left ,full) works. I'm working on this since 1 day and i'm now in a dead end. Does someone got this prob before or have a idea to solve this prob. Try a CROSS JOIN. |
#4
| |||
| |||
|
|
show us what you have so far |
|
Date | |date for the month Location | * | QtySales | | _________| |_______________ Tmp_Ord * dates |
#5
| |||
| |||
|
|
zac.carey (AT) gmail (DOT) com wrote: show us what you have so far Temp orders Table of date _________ _______________ | Date | |date for the month | Location | * | | QtySales | | |_________| |_______________ Tmp_Ord * dates Date Loc Qty DATE _______________ 30 july Mtl 30 Full 30 july 30 july Mtl 30 02 august Mtl 26 outer 01 august I wish 01august Mtl NULL 03 august Mtl 22 Join 02 august 02 august Mtl 26 30 july NY 33 on 03 august 03 august Mtl 22 01 august NY 85 Date 30 july NY 33 02 august NY 35 01 august NY 85 03 august NY 21 02 august NY 35 03 august NY 21 Is the above the output from your query copied and pasted? |
|
but i never get the new row : 01 august Mtl NULL |
|
here there is my query : select * FROM dbo.Temp_rptComparatif full outer join ( select [Date] from .dbo.Times where date between (select Min(Date) from dbo.Temp_rptComparatif ) and (select Max(Date) from dbo.Temp_rptComparatif ) ) ON (dbo.Temp_rptComparatif.[Date] = Times.[Date] ) thank you |
#6
| |||
| |||
|
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |