Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gavakie
Posting Yak Master
221 Posts |
Posted - 2010-08-18 : 17:38:11
|
| I have simple sub query that pulls in a date range, and an employee idand another table that has more detail and dates, and employee id'sI need to show fill in the blanks for the dates so if 8-6 was missing it needs to be merged with the right table and the rest can be null. |
|
|
gavakie
Posting Yak Master
221 Posts |
Posted - 2010-08-18 : 17:53:44
|
| Heres my query!Select ttDates.*From #ttTempRight Join (Select *From smb.dbo.vw_p_date_refWhere DTE between (Select [BEG COMM DATE] From AnalystSpace.dbo.DIRECT_SALES_PAYPERIOD p Where p.[END COMM DATE] in ('08/14/2010') ) and '08/14/2010')ttDates on ttDates.DTE = #ttTemp.Create_dteWhere SalesRep_oor = 40251 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-19 : 13:34:15
|
| which tables is having all dates and which one is missing details?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|