SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Timein Infront Of TimeOUT
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

asif372
Posting Yak Master

Pakistan
100 Posts

Posted - 05/21/2013 :  09:08:10  Show Profile  Reply with Quote
I am Working On Attendance System my Data is like this
ID Describing EmployeeID CheckTime Data describe the timings and Type Describing its type of IN or Out.

ID--------CheckTime---------------Type
11--------2013-01-01 09:00:00-----I
11--------2013-01-01 09:10:00-----I
11--------2013-01-01 09:11:00-----I
11--------2013-01-01 12:00:00-----O
11--------2013-01-01 12:02:00-----O
11--------2013-01-01 14:15:00-----I
11--------2013-01-01 14:45:00-----O
11--------2013-01-01 15:00:00-----I
11--------2013-01-01 15:03:00-----I
11--------2013-01-01 18:00:00-----O
11--------2013-01-01 18:00:00-----O
11--------2013-01-02 09:10:00-----I
11--------2013-01-02 09:11:00-----I
11--------2013-01-02 18:00:00-----O
11--------2013-01-02 18:05:00-----O

Basically i want first in second out third in fourth out and so on Concept like this

ID----DATE---------TimeIN-----TimeOut---
11--2013-01-01----09:00:00---12:02:00---
11--2013-01-01----14:15:00---14:45:00---
11--2013-01-01----15:00:00---18:00:00---
11--2013-01-02----09:10:00---18:05:00---


can my requirement be fullfill while using Pivot Table if yes than what will be the query or any other query way with better speed
Thanks in Advance
Regards

James K
Flowing Fount of Yak Knowledge

3578 Posts

Posted - 05/21/2013 :  10:20:18  Show Profile  Reply with Quote
Doesn't the queries people posted in this thread give you what you are looking for? http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=184712

Edited by - James K on 05/21/2013 10:22:32
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.03 seconds. Powered By: Snitz Forums 2000