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 2008 Forums
 Transact-SQL (2008)
 ABSENT REPORT

Author  Topic 

vipinjha123
Starting Member

45 Posts

Posted - 2012-05-07 : 00:42:12
Dear All,
I am looking for a query in which i can find the employee record who is absent from last 5 days continously.

my tabe structure is like

table name :-login
column

empid,logindate

THANKX & regards,
Vipin jha

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-07 : 00:51:27
what happen to the query that i posted here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=174351

Does it work ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

vipinjha123
Starting Member

45 Posts

Posted - 2012-05-07 : 00:56:22
i am not getting the correct record
i ma looking for only those employee record who is absent fopr last 5 days continouly

supppose toady is 6th may

i should get only those employee recoed who is absent from 1st may 2012

please modify your query
regards,
vipin jha
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-07 : 01:11:16
Please some sample data and the expected result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

vinu.vijayan
Posting Yak Master

227 Posts

Posted - 2012-05-08 : 08:49:20
Does this work?


Select empid From login_table
Where DATEDIFF(DD, loginDate, CURRENT_TIMESTAMP) >= 5


If it does not, then please post some sample data so that we can have a look at what your requirement is.
Please help us in helping you.

N 28° 33' 11.93148"
E 77° 14' 33.66384"
Go to Top of Page
   

- Advertisement -