CREATE TABLE #User_Message(Group_Trans_Id int, AKA_Id char(12), Term_Dt Date)
GO
INSERT INTO #User_Message(Group_Trans_Id, AKA_Id, Term_Dt)
SELECT 1, 'X002548', '1900-01-01' UNION ALL
SELECT 2, 'X002548', '1980-02-29' UNION ALL
SELECT 3, 'X002548', '9999-12-31' UNION ALL
SELECT 4, 'X002548', null UNION ALL
SELECT 5, 'X002548', GETDATE() UNION ALL
SELECT 6, 'X002548', null
GO
CREATE TABLE #myMessage(Group_Trans_Id int, Term_Dt Date, Expiration_Dt Date)
GO
INSERT INTO #myMessage(Group_Trans_Id, Term_Dt, Expiration_Dt)
SELECT 1, '1900-01-01','1900-01-01' UNION ALL
SELECT 2, null ,'1900-01-01' UNION ALL
SELECT 3, null , null UNION ALL
SELECT 4, null ,'01/01/2011' UNION ALL
SELECT 5, '01/01/2011',null UNION ALL
SELECT 5, null ,null
GO
DROP TABLE #User_Message, #myMessage
GO
Brett
8-)
Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Want to help yourself?
http://msdn.microsoft.com/en-us/library/ms130214.aspx
http://weblogs.sqlteam.com/brettk/
http://brettkaiser.blogspot.com/