June 12, 2011 at 7:05 pm
Hi,
I want to Delete the record number 3 and 4 which is incorrect . Those are coming by doing joins as final result and I can't bound the effective date. This is just an example. I have more than 100 incorrect records in my resultset.
I can bound them by start date but I don't know how to get the next start date by using loop, cursor or storing them in a variable to compare.
Please , suggest me the solution .
START DATE , EFFECTIVE DATE
1 8/6/07 12:00 AM , 8/6/07 12:00 AM
2 8/6/07 12:00 AM , 8/28/09 12:00 AM
3 8/6/07 12:00 AM , 7/7/10 12:00 AM
4 8/6/07 12:00 AM , 10/19/10 12:00 AM
5 10/5/09 12:00 AM , 10/5/09 12:00 AM
6 10/5/09 12:00 AM , 7/7/10 12:00 AM
7 10/5/09 12:00 AM , 8/20/10 12:00 AM
8 10/5/09 12:00 AM, 10/19/10 12:00 AM
Thanks.
June 12, 2011 at 8:56 pm
Duplicate post. Please reply to http://www.sqlservercentral.com/Forums/Topic1123992-391-1.aspx
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply