Click here to Skip to main content
15,920,438 members
Home / Discussions / Database
   

Database

 
QuestionSQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 18:13
Framework .l.11-Dec-11 18:13 
AnswerRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Mycroft Holmes11-Dec-11 19:04
professionalMycroft Holmes11-Dec-11 19:04 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 19:26
Framework .l.11-Dec-11 19:26 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Mycroft Holmes11-Dec-11 19:40
professionalMycroft Holmes11-Dec-11 19:40 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 20:47
Framework .l.11-Dec-11 20:47 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Mycroft Holmes11-Dec-11 22:13
professionalMycroft Holmes11-Dec-11 22:13 
GeneralRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Framework .l.11-Dec-11 22:34
Framework .l.11-Dec-11 22:34 
AnswerRe: SQL Server Management Studio R2 (varchar(MAX)) Pin
Eddy Vluggen12-Dec-11 8:37
professionalEddy Vluggen12-Dec-11 8:37 
Questiongenerate specific format in sql table Pin
sk_ko11-Dec-11 15:46
sk_ko11-Dec-11 15:46 
AnswerRe: generate specific format in sql table Pin
Mycroft Holmes11-Dec-11 19:00
professionalMycroft Holmes11-Dec-11 19:00 
GeneralRe: generate specific format in sql table Pin
sk_ko11-Dec-11 21:20
sk_ko11-Dec-11 21:20 
GeneralRe: generate specific format in sql table Pin
Mycroft Holmes11-Dec-11 22:11
professionalMycroft Holmes11-Dec-11 22:11 
AnswerRe: generate specific format in sql table Pin
PIEBALDconsult12-Dec-11 1:54
mvePIEBALDconsult12-Dec-11 1:54 
GeneralRe: generate specific format in sql table Pin
sk_ko12-Dec-11 2:57
sk_ko12-Dec-11 2:57 
AnswerRe: generate specific format in sql table Pin
jschell12-Dec-11 8:51
jschell12-Dec-11 8:51 
AnswerRe: generate specific format in sql table Pin
Eddy Vluggen12-Dec-11 10:15
professionalEddy Vluggen12-Dec-11 10:15 
Questionupdate and view news headline Pin
Jassim Rahma10-Dec-11 21:48
Jassim Rahma10-Dec-11 21:48 
AnswerRe: update and view news headline Pin
Wayne Gaylard10-Dec-11 22:26
professionalWayne Gaylard10-Dec-11 22:26 
QuestionGet start date Pin
Elizabeth Rani7-Dec-11 23:50
Elizabeth Rani7-Dec-11 23:50 
Hi all,

DECLARE
@holidayCount AS int,
@startDate AS datetime,
@endData AS datetime,
@empCode AS VARCHAR(20)

SET @startDate='12/6/2011 00:00:00.000'
SET @endDate='12/8/2011 23:59:59.997'
SET @empCode='EMP001'

SET @holidayCount=(SELECT COUNT(*) FROM tbl_holidays WHERE
holidays BETWEEN @startDate AND @endDate)

--I am assuming that 'holidays' is a datetime field/column

SELECT empCode, name, (Counts + @holidayCount) As holidayCounts
FROM
(
SELECT a.empCode, b.name, (Count(*) as Counts
FROM tbl_leaveentry a,tbl_emp b
WHERE a.empCode=b.empCode AND
a.empCode=@empCode AND
a.entryDate @startDate and @endDate
GROUP BY by a.empCode,b.name
) AS temp
WHERE Counts + @holidayCount>3

From the above query i got the count but now i need to get the start date of the leave that an employee had applied.

eg. 'EMP001' had applied leave from 12/1/2011 to 12/8/2011

but i have only one date option that is the end date. once you select the date option like 12/8/2011 it searches the dates from 2days before like 12/6/2011 and 12/8/2011 and returns the employees who have taken leaves continuously but i need to get the start date of the leave applied by the employee.

eg. EMP001 had applied leave from 12/1/2011 to 12/8/2011

Please suggest that how can i do this task any help will be appreciated
AnswerRe: Get start date Pin
Hum Dum8-Dec-11 0:11
Hum Dum8-Dec-11 0:11 
GeneralRe: Get start date Pin
Elizabeth Rani8-Dec-11 0:25
Elizabeth Rani8-Dec-11 0:25 
AnswerRe: Get start date Pin
SilimSayo8-Dec-11 10:49
SilimSayo8-Dec-11 10:49 
QuestionHow to Call A web service inside SQL server Pin
yousefshokati7-Dec-11 17:30
yousefshokati7-Dec-11 17:30 
AnswerRe: How to Call A web service inside SQL server Pin
David Skelly7-Dec-11 22:26
David Skelly7-Dec-11 22:26 
GeneralRe: How to Call A web service inside SQL server Pin
yousefshokati8-Dec-11 0:28
yousefshokati8-Dec-11 0:28 

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.