|
Posted by kamin on 07/07/06 17:52
rhaazy wrote:
> Please post propper DDL and table creation scripts and some sample data
> so that we may have a better understanding of the problem.
Scripts are as follows:
CREATE TABLE [dbo].[tyg_aging_due_dates] (
[due_date] [smalldatetime] NOT NULL ,
[object_type] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CS_AS NOT
NULL
) ON [PRIMARY]
-- Data
insert into tyg_aging_due_dates (due_date, object_type)
values ('2006-07-10', 'yg_report')
insert into tyg_aging_due_dates (due_date, object_type)
values ('2006-08-14', 'yg_report')
insert into tyg_aging_due_dates (due_date, object_type)
values ('2006-09-11', 'yg_report')
insert into tyg_aging_due_dates (due_date, object_type)
values ('2006-07-24', 'yg_decisionnote')
insert into tyg_aging_due_dates (due_date, object_type)
values ('2006-08-28', 'yg_decisionnote')
insert into tyg_aging_due_dates (due_date, object_type)
values ('2006-09-25', 'yg_decisionnote')
CREATE TABLE #tyg_aging_service_metrics (
[created_date] [datetime] NOT NULL DEFAULT (getdate()),
[due_date] [smalldatetime] NOT NULL ,
[res_ref_id] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CS_AS NOT
NULL ,
[object_type] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CS_AS NOT
NULL) ON [PRIMARY]
-- Data
insert into #tyg_aging_service_metrics (created_date, due_date,
res_ref_id, object_type)
values ('7/1/2006', '2006-08-14 00:00:00', '1234', 'yg_report')
insert into #tyg_aging_service_metrics (created_date, due_date,
res_ref_id, object_type)
values ('7/1/2006', '2006-09-25 00:00:00', '5524', 'yg_decisionnote')
So you see my temp table only has two records. I want to return all
the rows from the due_dates table regardless if they match those
records in tyg_aging_service_metrics.
Navigation:
[Reply to this message]
|