Click here to Skip to main content
15,907,233 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
SQL
DECLARE @attendance_date datetime
set @attendance_date  = '2014-02-20'
Posted
Updated 26-Feb-14 17:14pm
v4

 
Share this answer
 
Comments
Member 10501509 25-Feb-14 8:58am    
if i use between it will display absentees between the date range
Kornfeld Eliyahu Peter 25-Feb-14 9:16am    
It seems I did not understand you well...
Can you show an example of results?
Member 10501509 25-Feb-14 9:20am    
excepted output
16 Erappa Amanda 2014-02-20 00:00:00.000
25 Madhusudhan Rollapati 2014-02-21 00:00:00.000
27 Maruthi Krishnappagari 2014-02-22 00:00:00.000
Member 10501509 25-Feb-14 9:22am    
see in excepted output each user is absent for particular date that i want to display if i give between date range ,i mean to say date should be loop until the end date .
Kornfeld Eliyahu Peter 25-Feb-14 9:24am    
I cant' see why BETWEEN not works for you...
Try this

SQL
select  TM.TM_UserID, TM.FullName, @attendance_date 
from TM_User TM
where TM.is_active=1  and  TM.TM_UserID not in
(SELECT EM2.EmployeeID from Employee_Attendance EM2 
   WHERE EM2.CheckTime BETWEEN '20-02-2014' AND '21-02-2014')
 
Share this answer
 
Comments
Member 10501509 25-Feb-14 9:15am    
even want to display particular absentees date for user also
Does not seems any problem,
use cast function and convert all dates while using them
it should work;
 
Share this answer
 
Comments
Member 10501509 25-Feb-14 23:09pm    
Please can you provide a query .
Member 10501509 25-Feb-14 23:14pm    
I am unable to do please provide a query to me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900