Click here to Skip to main content
15,885,914 members
Home / Discussions / Database
   

Database

 
AnswerRe: Db over internet Pin
Chris Quinn27-Sep-12 2:36
Chris Quinn27-Sep-12 2:36 
Questionconnection of mssql 2008 to cloud in windows form application Pin
KUNWAR99921-Sep-12 3:28
KUNWAR99921-Sep-12 3:28 
AnswerRe: connection of mssql 2008 to cloud in windows form application Pin
David Mujica21-Sep-12 3:50
David Mujica21-Sep-12 3:50 
AnswerRe: connection of mssql 2008 to cloud in windows form application Pin
Eddy Vluggen21-Sep-12 4:44
professionalEddy Vluggen21-Sep-12 4:44 
QuestionSQL XP_StartSMTP to send email Pin
MWRivera20-Sep-12 5:45
MWRivera20-Sep-12 5:45 
AnswerRe: SQL XP_StartSMTP to send email Pin
Chris Meech21-Sep-12 2:45
Chris Meech21-Sep-12 2:45 
AnswerRe: SQL XP_StartSMTP to send email Pin
Eddy Vluggen21-Sep-12 4:47
professionalEddy Vluggen21-Sep-12 4:47 
QuestionContinuous absent query Pin
RA|-|UL PATEL20-Sep-12 3:16
RA|-|UL PATEL20-Sep-12 3:16 
SQL
I am creating report for displaying continuous absent for more than 2 days.Query is build and working fine.Range is passed by using @StartDate and @EndDate. but problem is if In between two absent week off comes then it is also considered as continuous absent.i want to add that functionality to the existing query.How can i do that?

Existing query is:



SQL
WITH Dates
(
    EntryDate,
    EmployeeNumber,
    Status,
    Days,
    EmployeeCode,
    EmployeeName,
    DeptName,
    JobName,
    HOD,
    Supervisor
) 
AS
(
    SELECT
        a.[DATE],
        a.EmployeeID,
        a.Status,
        1,a.EmployeeCode,a.EmployeeName,a.DeptName,a.JobName,a.HOD,a.Supervisor
    FROM
        tblEmployeeAttendance1 a

    WHERE
        a.[Date] between @StartDate and @EndDate and (a.status='AB' OR a.Status='O')
    -- RECURSIVE    
    UNION ALL

    SELECT
        a.[DATE],
        a.EmployeeID,
        a.Status,
        CASE WHEN (a.Status = Parent.Status) THEN Parent.Days + 1 ELSE 1 END,
        a.EmployeeCode,a.EmployeeName,a.DeptName,a.JobName,a.HOD,a.Supervisor
    FROM
        tblEmployeeAttendance1 a 
    INNER JOIN
        Dates parent
    ON
        datediff(day, a.[DATE], DateAdd(day, 1, parent.EntryDate)) = 0 
    AND
        a.EmployeeID = parent.EmployeeNumber  where a.[Date] between @StartDate and @EndDate and (a.status='AB' OR a.Status='O')
)
SELECT * FROM Dates where days>=2 order by EmployeeNumber, EntryDate

AnswerRe: Continuous absent query Pin
Corporal Agarn20-Sep-12 8:04
professionalCorporal Agarn20-Sep-12 8:04 
AnswerRe: Continuous absent query Pin
Hitesh R5-Nov-12 23:24
Hitesh R5-Nov-12 23:24 
Questionhow to update combobox values in msaccess tables in ACCESS2007 Pin
ssskp3219-Sep-12 20:40
ssskp3219-Sep-12 20:40 
QuestionSpecifying Seed Values on model building Pin
solomon20118-Sep-12 5:34
solomon20118-Sep-12 5:34 
AnswerRe: Specifying Seed Values on model building Pin
Simon_Whale18-Sep-12 5:47
Simon_Whale18-Sep-12 5:47 
GeneralRe: Specifying Seed Values on model building Pin
R. Giskard Reventlov18-Sep-12 8:19
R. Giskard Reventlov18-Sep-12 8:19 
AnswerRe: Specifying Seed Values on model building Pin
R. Giskard Reventlov18-Sep-12 8:22
R. Giskard Reventlov18-Sep-12 8:22 
AnswerRe: Specifying Seed Values on model building Pin
Eddy Vluggen21-Sep-12 4:52
professionalEddy Vluggen21-Sep-12 4:52 
Questionmultiple data instances one machine Pin
John Robert Wilk17-Sep-12 8:15
John Robert Wilk17-Sep-12 8:15 
AnswerRe: multiple data instances one machine Pin
Jörgen Andersson17-Sep-12 8:55
professionalJörgen Andersson17-Sep-12 8:55 
AnswerRe: multiple data instances one machine Pin
Wes Aday17-Sep-12 9:01
professionalWes Aday17-Sep-12 9:01 
GeneralRe: multiple data instances one machine Pin
John Robert Wilk17-Sep-12 9:08
John Robert Wilk17-Sep-12 9:08 
GeneralRe: multiple data instances one machine Pin
Wes Aday17-Sep-12 9:14
professionalWes Aday17-Sep-12 9:14 
GeneralRe: multiple data instances one machine Pin
John Robert Wilk17-Sep-12 9:17
John Robert Wilk17-Sep-12 9:17 
GeneralRe: multiple data instances one machine Pin
Wes Aday17-Sep-12 9:23
professionalWes Aday17-Sep-12 9:23 
AnswerRe: multiple data instances one machine Pin
jschell17-Sep-12 9:16
jschell17-Sep-12 9:16 
GeneralRe: multiple data instances one machine Pin
John Robert Wilk17-Sep-12 9:21
John Robert Wilk17-Sep-12 9:21 

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.