Viewing 15 posts - 91 through 105 (of 107 total)
Can you help me in this...
Same source table
ALTER PROCEDURE Emp_Shift1
(
@empcode INT,
@FromDate datetime,
@EndDate datetime
)
AS
BEGIN
--DROP TABLE #t
CREATE TABLE #t(
[Date] date,
[Empid]...
May 11, 2016 at 4:19 am
CREATE TABLE dbo.ShiftScheduler(FromDate DATETIME,Shift INT,ShiftType INT ,Emp_Code VARCHAR(50))
CREATE TABLE dbo.Emploee(FromDate DATETIME,Shift INT,ShiftType INT ,empid VARCHAR(50))
INSERT INTO dbo.Emploee values('1/1/2015','1/4/2015',1,1,3321)
INSERT INTO dbo.Emploee values('1/7/2015 ','1/8/2015 ',1,1,3321)
INSERT INTO dbo.ShiftScheduler VALUES('1/5/2015','1/6/2015',2,4,3321)
INSERT INTO dbo.ShiftScheduler VALUES('1/9/2015','1/10/2015',2,4,3321)
May 11, 2016 at 2:39 am
Hi,
Almost done with it..please check some bugs still
ALTER PROCEDURE Emp_Shift1
(
@empcode INT,
@FromDate datetime,
@EndDate datetime
)
AS
BEGIN
--DROP TABLE #t
CREATE TABLE #t(
[Date] date,
[Empid]...
May 11, 2016 at 2:13 am
Thank you so much it is working has expected...Thanks a lot
May 11, 2016 at 1:38 am
ALTER PROCEDURE Emp_Shift1
@empcode varchar(50),
@FromDate datetime,
@EndDate datetime
AS
BEGIN
DECLARE @TotDays INT
DECLARE @CNT INT
SET @TotDays = DATEDIFF(DD,@FromDate,@EndDate)-- [NO OF DAYS between two dates]
...
May 11, 2016 at 1:08 am
If he is shift 1 shifttype 1then the record comes from employee table
if he is shift 2 shifttype 4 then the record comes from shiftscheduler table
For example :
I want...
May 11, 2016 at 12:24 am
Hi..There are two tables employee and Shiftscheduler which to include where...since yourtable i am not get it exactly
May 9, 2016 at 4:26 am
USE [process]
GO
/****** Object: StoredProcedure [dbo].[Emp_Shift2] Script Date: 05/02/2016 15:01:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Emp_Shift3]
@FromDate datetime,
@EndDate datetime
AS
BEGIN
----CREATE TABLE #Newtemp(ID INT,Emp_Code VARCHAR(50),Shift INT,ShiftType INT,FromDate datetime,EndDate...
May 9, 2016 at 4:18 am
Find the employee is in which shift and shifttype
If he is shift 1 shifttype 1then the record comes from employee table
if he is shift 2 shifttype 4 then the record...
May 9, 2016 at 2:50 am
USE [process]
GO
/****** Object: StoredProcedure [dbo].[Emp_Shift2] Script Date: 05/02/2016 15:01:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Emp_Shift3]
@FromDate datetime,
@EndDate datetime
AS
BEGIN
CREATE TABLE #WorkDays(empid1 INT,shift1 INT,shifttype1 INT)
INSERT INTO #WorkDays(empid1,shift1,shifttype1)
SELECT...
May 9, 2016 at 1:09 am
Sample
Input (Choose it from date to to date)
Date Empid ...
May 3, 2016 at 2:44 am
Hi, Thanks for ur reply
My requirement is like i have two tables one is Shiftscheduler (captures only when Shift and shifttype is 2 and 4 respectively) and another table is...
May 2, 2016 at 4:24 am
Consider my count is 30
using while loop i am decrement it..till it reaches zero
count =30
then output should be
Empid empname ...
April 29, 2016 at 2:56 am
For Achieving the above output i tried like this
ALTER PROCEDURE Emp_Shift1
@empcode varchar(50),
@FromDate datetime,
@EndDate datetime
AS
BEGIN
DECLARE @TotDays INT
DECLARE @CNT INT
SET @TotDays =...
April 27, 2016 at 12:46 am
Thanks for all your reply...My output concern is from date '2016-04-01','2016-04-24' it has to display all the dates shift type..output sample
Date ...
April 26, 2016 at 11:11 pm
Viewing 15 posts - 91 through 105 (of 107 total)