USE [SDE]
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[RPT_GET_STAFF_CALL_DATA]
@FDate datetime, @FTDate datetime
as
SET NOCOUNT ON
declare @FDTE datetime, @TDTE datetime
/*Set @FDTE = convert(datetime,@FDate,101)
Set @TDTE = convert(datetime,@FTDate,101)
*/
Set @FDTE= @FDate
Set @TDTE = @FTDate
Select
"SEQUENCE",
"FNAME",
"NAME",
("FNAME" + ' ' + "NAME") as
"Full Name",
(SELECT count("SEQUENCE")
FROM "_SMDBA_"."_TELMASTE_" as INC
WHERE INC."SENT TO" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and "DATE OPEN" >= @FDTE
and "DATE OPEN" < @TDTE) as
"Assigned Calls",
(SELECT count("SEQUENCE")
FROM "_SMDBA_"."_TELMASTE_" as INC
WHERE INC."SENT TO" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and datediff(year,"DATE OPEN",getdate()) = 0) as
"Opened Calls YTD",
(SELECT count("SEQUENCE")
FROM "_SMDBA_"."_WORKORD_" as WO
WHERE WO."OPEN BY" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and "DATE OPEN" >= @FDTE
and "DATE OPEN" < @TDTE) as
"Opened WO's",
(SELECT count("SEQUENCE")
FROM "_SMDBA_"."_WORKORD_" as WO
WHERE WO."OPEN BY" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and datediff(year,"DATE OPEN",getdate()) = 0) as
"Opened WOS YTD",
(SELECT count("SEQUENCE")
FROM "_SMDBA_"."_TELMASTE_" as INC
WHERE INC."SOLVED_BY" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and "HD_CCDT01" >= @FDTE
and "DATE OPEN" < @TDTE) as
"Closed Calls",
(SELECT count("SEQUENCE")
FROM "_SMDBA_"."_TELMASTE_" as INC
WHERE INC."SOLVED_BY" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and datediff(year,"DATE OPEN",getdate()) = 0) as
"Closed Calls YTD",
(SELECT count("SEQUENCE") FROM "_SMDBA_"."_WORKORD_" as WO
WHERE WO."CLOSED BY" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and "CLOSED ON" >= @FDTE and "DATE OPEN" < @TDTE)
as "Closed WO's",
(SELECT count("SEQUENCE") FROM "_SMDBA_"."_WORKORD_" as WO
WHERE WO."CLOSED BY" = "_SMDBA_"."_PERSONNEL_"."SEQUENCE"
and datediff(year,"CLOSED ON",getdate()) = 0)
as "Closed WOS YTD",
(SELECT count("SEQUENCE") FROM "_SMDBA_"."_TELMASTE_" WHERE
"DATE OPEN" >= @FDTE and "DATE OPEN" < @TDTE)
as TOT_Calls_DRNGE,
(SELECT count("SEQUENCE") FROM "_SMDBA_"."_TELMASTE_" WHERE datediff(year,"DATE OPEN",getdate()) = 0)
as TOT_Calls_YTD,
(SELECT count("SEQUENCE") FROM "_SMDBA_"."_WORKORD_" WHERE
"DATE OPEN" >= @FDTE and "DATE OPEN" < @TDTE)
as TOT_WOS_DRNGE,
(SELECT count("SEQUENCE") FROM "_SMDBA_"."_WORKORD_" WHERE datediff(year,"DATE OPEN",getdate()) = 0)
as TOT_WOS_YTD,
@FDTE as "From Date",@TDTE as "To Date"
FROM "_SMDBA_"."_PERSONNEL_"
order by "Full Name"
过程或函数''需要参数'@FDate',这是未提供的。 @FDate和@FTDate显示错误?!!任何人都可以帮助我
我在水晶报告中使用此程序,每当我为报告设置数据库位置时,它会询问参数并提供它们,但没有运气我会得到错误吗?!!