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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 ssms query logic

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2012-06-12 : 07:30:41


Dear all

this is my table structure

id attendencedate status ...

10 2012/mar/10 w
10 2012/mar/11 w
10 2012/mar/12 PL (PAID LEAVE
10 2012/mar/13 w
10 2012/mar/14 A (ABSENT)
10 2012/mar/15 A
10 2012/mar/16 A
10 2012/mar/17 PL
10 2012/mar/18 A
10 2012/mar/19 A
10 2012/mar/20 A
10 2012/mar/21 A
10 2012/mar/22 A


here i want to know the employee 3 or more than 3 days continously ABSENT

STATUS 'a' DENOTES ABSENT
above mentionED data id 10 is
2012-mar-14 to 2012-MAR-16
2012-MAR-18 TO 2012-MAR-22 CONTINUSLY ABSENT


ANY BODY KNOW THE LOGIC
pls explain
me

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-06-12 : 07:46:06
quote:
Originally posted by kond.mohan



Dear all

this is my table structure

id attendencedate status ...

10 2012/mar/10 w
10 2012/mar/11 w
10 2012/mar/12 PL (PAID LEAVE
10 2012/mar/13 w
10 2012/mar/14 A (ABSENT)
10 2012/mar/15 A
10 2012/mar/16 A
10 2012/mar/17 PL
10 2012/mar/18 A
10 2012/mar/19 A
10 2012/mar/20 A
10 2012/mar/21 A
10 2012/mar/22 A


here i want to know the employee 3 or more than 3 days continously ABSENT

STATUS 'a' DENOTES ABSENT
above mentionED data id 10 is
2012-mar-14 to 2012-MAR-16
2012-MAR-18 TO 2012-MAR-22 CONTINUSLY ABSENT


ANY BODY KNOW THE LOGIC
pls explain
me

Is this the same problem as what you posted in http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=175672 ?

People who moderate this forum frown upon people posting the same question to more than one thread.
Go to Top of Page
   

- Advertisement -