Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Generate new Row After Calculation
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

100 Posts

Posted - 01/08/2013 :  06:39:09  Show Profile  Reply with Quote
My Data is Like this

ID; TimeIn; TimeOut;
1; 9:00; 12:00;
1; 5:00; 6:00;

I want to Generate a mid Row my Required Data is like this

ID; TimeIn; TimeOut;
1; 12:00; 5:00;

How can it be Possible
Thanks in Advance

Flowing Fount of Yak Knowledge

United Kingdom
3385 Posts

Posted - 01/08/2013 :  06:59:42  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
I suspect you need to define what you want a bit more precisely but

insert tbl
select, t1.timeout, t2.timein
from tbl t1
join tbl t2
on =
and t1.timein < t2.timein

Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000