Click here to Skip to main content
15,896,063 members
Home / Discussions / Database
   

Database

 
AnswerRe: Select with pivot Pin
CHill6023-Jun-21 4:50
mveCHill6023-Jun-21 4:50 
GeneralRe: Select with pivot !! Pin
User 1407655213-Jul-21 21:34
User 1407655213-Jul-21 21:34 
GeneralRe: Select with pivot !! Pin
CHill6014-Jul-21 3:50
mveCHill6014-Jul-21 3:50 
GeneralRe: Select with pivot !! Pin
User 1407655214-Jul-21 3:58
User 1407655214-Jul-21 3:58 
GeneralRe: Select with pivot !! Pin
CHill6014-Jul-21 4:09
mveCHill6014-Jul-21 4:09 
QuestionAbout MySQL table permission removal failed Pin
Member 1105472311-Jun-21 8:00
Member 1105472311-Jun-21 8:00 
AnswerRe: About MySQL table permission removal failed Pin
Richard Deeming13-Jun-21 22:09
mveRichard Deeming13-Jun-21 22:09 
QuestionSandwich Query For Employee Attendance using SQL Server 2005 Pin
Mohammad Salmani8-Jun-21 20:40
Mohammad Salmani8-Jun-21 20:40 
AnswerRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Richard MacCutchan8-Jun-21 21:55
mveRichard MacCutchan8-Jun-21 21:55 
AnswerRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
SeeSharp29-Jun-21 1:35
SeeSharp29-Jun-21 1:35 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Mohammad Salmani9-Jun-21 3:08
Mohammad Salmani9-Jun-21 3:08 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
SeeSharp29-Jun-21 3:39
SeeSharp29-Jun-21 3:39 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
David Mujica9-Jun-21 4:25
David Mujica9-Jun-21 4:25 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Mycroft Holmes9-Jun-21 12:36
professionalMycroft Holmes9-Jun-21 12:36 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
SeeSharp210-Jun-21 1:25
SeeSharp210-Jun-21 1:25 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Mycroft Holmes10-Jun-21 12:09
professionalMycroft Holmes10-Jun-21 12:09 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Mohammad Salmani10-Jun-21 21:53
Mohammad Salmani10-Jun-21 21:53 
Hi,

I have implemented as per below query,If Employee is absent on Saturday and Monday the weeklyoff should be counted as Absent. I have passed the process date parameter in place of static date.


SELECT A.EmpCode,A.AttDate As Sundate FROM Attendance_Details A INNER JOIN (SELECT A.Empcode,A.AttDate As SatDate,A.AttStatus As SatStatus
FROM Attendance_Details A INNER JOIN (SELECT EmpCode,AttDate As MonDate,AttStatus As MonStatus FROM Attendance_Details
WHERE AttDate='2021-06-07' AND DATENAME(WEEKDAY, '2021-06-07') = 'Monday' and AttStatus IN ('A','HL'))T ON T.EmpCode=A.EmpCode
WHERE DATENAME(WEEKDAY, DATEADD(day,-2,'2021-06-07')) = 'Saturday' AND AttStatus IN ('A') AND AttDate=DATEADD(day,-2,'2021-06-07'))T1
ON A.EmpCode=T1.EmpCode AND DATENAME(WEEKDAY, DATEADD(day,-1,'2021-06-07')) = 'Sunday' AND AttStatus NOT IN('AL','SL','PL','ML','FL') AND AttDate=DATEADD(day,-1,'2021-06-07')

Please help to improve the above query...


Thanks & Regards
Mohammad Salmani
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
SeeSharp211-Jun-21 1:20
SeeSharp211-Jun-21 1:20 
QuestionLoad JSON file from network location Pin
Member 144746073-Jun-21 7:36
Member 144746073-Jun-21 7:36 
AnswerRe: Load JSON file from network location Pin
Member 144746073-Jun-21 8:42
Member 144746073-Jun-21 8:42 
AnswerRe: Load JSON file from network location Pin
Mycroft Holmes3-Jun-21 12:15
professionalMycroft Holmes3-Jun-21 12:15 
QuestionSQL Server 2010, smalldatetime insert Pin
jkirkerx1-Jun-21 14:52
professionaljkirkerx1-Jun-21 14:52 
AnswerRe: SQL Server 2010, smalldatetime insert Pin
Mycroft Holmes1-Jun-21 21:31
professionalMycroft Holmes1-Jun-21 21:31 
AnswerRe: SQL Server 2010, smalldatetime insert Pin
Victor Nijegorodov1-Jun-21 21:49
Victor Nijegorodov1-Jun-21 21:49 
AnswerRe: SQL Server 2010, smalldatetime insert Pin
jkirkerx2-Jun-21 8:47
professionaljkirkerx2-Jun-21 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.