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.
Author |
Topic |
vipinjha123
Starting Member
45 Posts |
Posted - 2012-05-05 : 05:31:29
|
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 liketable name :-logincolumnempid logindateregards,Vipin jha |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-05-05 : 05:35:04
|
does the logindate contain time ?is it one record per day ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
vipinjha123
Starting Member
45 Posts |
Posted - 2012-05-05 : 05:49:18
|
no it does not contain timeonly dateone reecord per day |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-05-05 : 06:11:46
|
[code]select e.empidfrom employee ewhere not exists ( select * from login x where x.empid = e.empid and x.logindate >= dateadd(day, datediff(day, 0, getdate()), -5) and x.logindate <= dateadd(day, datediff(day, 0, getdate()), -1) )[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|