还不清楚 [英] still not clear

查看:94
本文介绍了还不清楚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谢谢你这个解决方案Hugo(荷兰人?)而且它非常方便,谢谢

你但我的问题是我们用我的功能创建了几十个视图。

此函数返回日期的整数。当日期超出日历范围时,此功能必须提供

lowerlimit和更高限制。


但是我想从Calendartable ONCE和商店中读取这个它在SQL Server中某处的某个
全局变量中。我不想在我的函数中引用

表。 SO读取下限和上限并使用

这个变量/属性在我的函数中引用!!

Greetz

Hennie

***通过开发人员指南 http://www.developersdex.com发送 ***

不要只是参加USENET ......获得奖励!

解决方案

< blockquote>

" Hennie de Nooijer" < HD ******** @ hotmail.com>写在消息

新闻:41 ********** @ 127.0.0.1 ...

谢谢你这个解决方案雨果(荷兰人?)并且它非常方便,谢谢你,但我的问题是我们用我的函数创建了几十个视图。
这个函数返回一个日期的整数。当日期超出日历范围时,此函数必须提供
lowerlimit和higherlimit。

但是我想从Calendartable ONCE中读取它并将其存储在
全局中SQL Server中的某个变量。我不想在我的函数中引用
表。所以读取一次下限和上限并使用
这个变量/属性在我的函数中引用!!

Greetz
Hennie

***通过开发人员发送的指南 http://www.developersdex.com ***
唐只是参加USENET ......获得奖励!




我没看过你以前的帖子,但是没有全局变量/>
TSQL,你可以存储数据的唯一地方是一个表 - 为了这个目的,有一个dbo.Constants(或其他)表通常是非常好的。


如果您可以使用存储过程或表值函数而不是视图,那么

可能会执行一些操作,例如检索一次正确的日期值,

然后将它们作为参数传递给每个proc / function,但我不知道

在你的情况下是不是一个好主意。如果你肯定需要使用

视图,那么你可能会考虑用视图定义中的CASE语句替换你的函数




如果这没有用,你可能想为你的表,视图,函数和样本数据提供(简化的)DDL和

INSERT语句,这些语句可以是

可以在质量保证中运行 - 有一个明确的问题示例,有人可能会给b $ b做出更好的建议。 (抱歉,如果你已经在另一个

帖子中这样做了。)


Simon


2005年1月4日03:15:22 -0600,Hennie de Nooijer写道:

谢谢你这个解决方案Hugo(荷兰人?),这非常方便,谢谢
你但我的问题是我们用我的函数创建了几十个视图。
这个函数返回一个日期的整数。当日期超出日历范围时,此功能必须提供
lowerlimit和higherlimit。


Hoi Hennie,

Ja,ik ben inderdaad Nederlander。 Jij ook,neem ik aan? :-)

但是让我们继续用英语 - 毕竟这是一个英语小组。


你能发布你函数的当前代码吗? ?我不明白

想要改变在很多地方使用过的东西,但我想它可能会改变函数的代码来做同样的事情。现在正在做

,但没有你遇到的限制。但是,我只能确定我是否能看到你的代码。


但是我想从Calendartable ONCE中读取这个并将其存储在
SQL Server中的某个全局变量。我不想在我的函数中引用
表。 SO读取下限和上限并使用
这个变量/属性在我的函数中引用!!




Simon是正确的 - 没有全局变量。除此之外,我还

我不确定我是否真的理解你想要实现的目标,所以我将b / b
将要求发布表结构(作为CREATE TABLE

语句),示例数据(作为INSERT语句)和预期输出沿着

描述您正试图解决的问题。这可能会帮助我(和其他人)了解你想要实现的目标。检查这个

网站: http://www.aspfaq.com/ 5006 - 它有一些宝贵的技巧可以帮助你

汇总所要求的数据。


Best,Hugo

-


(删除_NO_和_SPAM_以获取我的电子邮件地址)


好的,这里的印象是我的观点(见下文)。你可以看到我打电话给

函数xxxxx_FN_GetDateString(ISNULL(Intake_Date,''1990-01-01

00:00:00''))多次这个函数返回一个整数:

19900101.不超过这个!!!


日历表(参见下面的创建脚本)包含有关

日期,哪个月,哪一天等。这是

数据仓库中的标准表。没什么特别的。 Calendar_Dim_key与我的生成日期

具有相同的密钥:例如,19900101。


如果我想返回minimumdate和maximumdate(因为我的

calendartable有限的日期信息)

如果想要使用日历中的最低日期和最高日期

表我将不得不创建一个SELECT MIN(Calendar_Dim_Key)FROM

SDM_Calendar和SELECT MAX(Calendar_Dim_Key)来自SDM_Calendar我的

功能。


每次我调用此函数它将执行此查询两次,但

此信息已被检索,此前调用此

函数。这让我很恼火。我想要一个电话,检索

信息并多次使用....


例如:


我的日历表范围从1980年到2049年,当sourcetable有一个

日期,如01-05-249,该函数必须返回19800101日期(249<

1980)不是2490501,因为这是一个错误的日期。


所以我希望它现在更容易理解。 Thanx。


en ja hugo ik ben ook nederlander ;-) ik hoop dat dit wat duidelijker is。


Greetz


Hennie


------------------------------ -------------------

这是日历表的创建脚本:

----- --------------------------------------------

CREATE TABLE [dbo]。[SDM_Calendar](

[Calendar_Dim_Key] [int] NOT NULL,

[Full_Date_App] [datetime] NOT NULL,

[Day_of_Month] [tinyint] NOT NULL,

[Day_of_Year] [smallint] NOT NULL,

[Day_Full_Name] [varchar](9)COLLATE SQL_Latin1_General_CP1_CI_AS NOT

NULL,

[Week_Number] [tinyint] NOT NULL,

[Month_Full_Name] [varchar](9)COLLATE SQL_Latin1_General_CP1_CI_AS

NOT NULL,

[Month_Number] [tinyint] NOT NULL,

[Quarter] [tinyint] NOT NULL,

[ Quarter_Full_Name] [varchar](9)COLLATE SQL_Latin1_General_CP1_CI_AS

NULL,

[Calendar_Year] [smallint] NOT NULL

)ON [SAMIS_SDM_Index1]

GO

----------------------------------------------

这是视图

--------------------------------- --------------

创建视图TR_Fact_Event_Action1_V

AS

SELECT

Event_Process_Type为Event_Process_Type_Code,

...........

ISNULL(contract_id,''N / A'')为Serv_Contract_Code,

ISNULL(Site_category,''N / A'')作为Event_Site_Category_Code,

ISNULL(Cause_Code,''N / A'')作为Event_Cause_Code,

ISNULL(Resolution_Code,''N / A'')为Event_Resolution_Code,

..........

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL( Cl ose_Time,Open_Time))

为FK_Event_Close_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Cl ose_Time,Open_Time))

为FK_Event_Close_Time,

xxxxx_Control.dbo.xxxxx_F N_GetDateString(ISNULL(Re open_Time,Open_Time))

为FK_Event_Reopen_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Re open_Time,Open_Time))

作为FK_Event_Reopen_Time,
$ b $)))为FK_Event_Site_Visit_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString (ISNULL(Si te_Visit_Time,Open_Tim
$ b $))为FK_Event_Site_Visit_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(SL A_Expire_Time,Open_Tim

e))作为FK_Event_SLA_Expire_Date,
$ b $))为FK_Event_SLA_Expire_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString( ISNULL(Re quest_Date,''1990-01-01

00:00:00''))为FK_Event_Request_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Re quest_Date) ,''1990-01-01

00:00:00''))为FK_Even t_Request_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Ne gotiate_Date,''1990-01-

01 00:00:00''))为FK_Event_Negotiate_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Ne gotiate_Date,

''1990-01-01 00:00:00''))为FK_Event_Negotiate_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(在take_Date,''1990-01-01

00:00:00''))为FK_Event_Intake_Date,

xxxxx_Control。 dbo.xxxxx_FN_GetTimeString(ISNULL(在take_Date,''1990-01-01

00:00:00''))为FK_Event_Intake_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString( ISNULL(Pl anned_Start_Time,''1990

-01-01 00:00:00''))为FK_Event_Planned_Start_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Pl anned_Start_Time) ,''1990

-01-01 00:00:00''))为FK_Event_Planned_Start_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Pl anned_End_Time,' 1990-0

1-01 00:00:00''))为FK_Event_Planned_End_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Pl anned_End_Time,''1990-0

1-01 00:00:00''))为FK_Event_Planned_End_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Im plement_Start_Time,''19

90-01-01 00:00:00''))为FK_Event_Implement_Start_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Im plement_Start_Time,''19

90-01-01 00:00:00''))为FK_Event_Implement_Start_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Im plement_End_Time,''1990

-01- 01 00:00:00''))为FK_Event_Implement_End_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Im plement_End_Time,''1990

-01-01 00:00 :00''))作为FK_Event_Implement_End_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Ac tion_Open_Time,Open_Ti

me))作为FK_Action_Open_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Ac tion_Open_Time,Open_Ti

me))作为FK_Action_Open_Time,

xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(IS NULL)(Action_Close_Time

,Close_Time),Open_Time))为FK_Action_Close_Date,

xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(IS NULL(Action_Close_Time

,Close_Time),Open_Time) )作为FK_Action_Close_Time,

......

CASE

当Close_Time不为空时那么

xxxxx_Control .dbo.xxxxx_FN_GetDiffSLA

(ISNULL(SLA_Expire_Time,Close_Time),

Close_Time,ISNULL(service_schedule,''N / A''),''Y'',' 'N'')

ELSE 0 END,0)as SLA_Exceed_Closed_Time_Min,

''0''AS SLA_Exceed_Closed_Time_Min_2,

ISNULL(

CASE

当Resolved_Time不为空时

xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA(Open_Time,

Resolved_Time,ISNULL(service_schedule) '' N / A '' ),''Y'',''N'')

WHEN Resolved_Time为NULL且Close_Time不为NULL

xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA(Open_Time,

Close_Time,ISNULL(service_schedule,''N / A''),''Y'',''N'')

ELSE 0 END,0)as Event_Duration_Resolved_Time_Min,

ISNULL(

CASE

当Close_Time不为空时那么

xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA(Open_Time,

Close_Time,ISNULL(service_schedule,''N / A''),''Y'',''N'')

ELSE 0 END,0)as Event_Duration_Closed_Time_Min ,

ISNULL(

xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA(Action_Open_Time,

Action_Close_Time,ISNULL(service_schedule,''N / A''), ''Y'',''N''),0)as

Action_Duration_Min,

CASE

WHEN Event_Process_Type =''Call' '

那么DATEDIFF(ss,''4000-01-01 00:00:00'',call_handle_time)ELSE 0

结束为Call_Handling_Sec,

ISNULL(Planned_Hours,0)as Event_Planned_Hours,

ISNULL(Spent_Hours,0)as Event_Spent_Hours,

ISNULL(Remaining_Hours ,0)as Event_Remaining_Hours,

ISNULL(sysmodtime,GETDATE())as Sysmodtime

FROM

SAD_Fact_Event_Action


***通过开发人员指南 http://www.developersdex.com 发送* **

不要只是参加USENET ......获得奖励!


hi thank you for this solution Hugo (dutch?) and it''s very handy, thank
you but my issue is that we created dozens of views with my function.
This functions returns an integer of a date. This function has to give a
lowerlimit and higherlimit back when dates are out of Calendar range.

But i want to read this from the Calendartable ONCE and store it in a
global variable somewhere in SQL Server. I DON''T want to reference
tables in my function. SO read once the lower- and upperlimit and use
this variable/property for referencing in my function!!
Greetz
Hennie

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

解决方案


"Hennie de Nooijer" <hd********@hotmail.com> wrote in message
news:41**********@127.0.0.1...

hi thank you for this solution Hugo (dutch?) and it''s very handy, thank
you but my issue is that we created dozens of views with my function.
This functions returns an integer of a date. This function has to give a
lowerlimit and higherlimit back when dates are out of Calendar range.

But i want to read this from the Calendartable ONCE and store it in a
global variable somewhere in SQL Server. I DON''T want to reference
tables in my function. SO read once the lower- and upperlimit and use
this variable/property for referencing in my function!!
Greetz
Hennie

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



I haven''t read your previous posts, but there are no global variables in
TSQL, and the only place you can store data is in a table - it''s quite
common to have a dbo.Constants (or whatever) table for this purpose.

If you can use stored procs or table-valued functions instead of views you
might be able to do something such as retrieve the correct date values once,
then pass them to each proc/function as parameters, but I have no idea if
that would be a good idea in your situation. If you definitely need to use
views then you might look into replacing your function with a CASE statement
in the view definition.

If that doesn''t help, you might want to give a (simplified) set of DDL and
INSERT statements for your table, view, function and sample data which can
be run in QA - with a clear example of your problem, someone may be able to
make a better suggestion. (Apologies if you''ve already done this in another
post.)

Simon


On 4 Jan 2005 03:15:22 -0600, Hennie de Nooijer wrote:

hi thank you for this solution Hugo (dutch?) and it''s very handy, thank
you but my issue is that we created dozens of views with my function.
This functions returns an integer of a date. This function has to give a
lowerlimit and higherlimit back when dates are out of Calendar range.
Hoi Hennie,

Ja, ik ben inderdaad Nederlander. Jij ook, neem ik aan? :-)
But let''s continue in English - this is an English group, after all.

Could you post the current code of your function? I can understand not
wanting to change something used in so many places, but I guess it might
be possible to change the function''s code to do the same as it is doing
now, but without the limitations you are experiencing. However, I can only
be sure if I see your code.

But i want to read this from the Calendartable ONCE and store it in a
global variable somewhere in SQL Server. I DON''T want to reference
tables in my function. SO read once the lower- and upperlimit and use
this variable/property for referencing in my function!!



Simon is correct - there are no global variables. Other than that, I also
am not sure if I really understand what you are trying to achieve, so I
will second Simon''s request to post table structure (as CREATE TABLE
statements), sample data (as INSERT statements) and expected output along
with the description of the problem you''re trying to solve. That might
help me (and others) understand what you''re trying to achieve. Check this
site: http://www.aspfaq.com/5006 - it has some valuable tips to help you
assemble the requested data.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)


Ok here ''s an impression of my view(see below). As you can see i called
the function xxxxx_FN_GetDateString(ISNULL(Intake_Date,''1990-01-01
00:00:00'')) multiple times This function returns an integer back :
19900101. Not more than that!!!

The calendar table (see create script below) has information about the
dates, which month, which day, etc. This is standard table in a
datawarehouse. Nothing special. The Calendar_Dim_key has the same key as
my generated date : 19900101 for example.

If i want to return a minimumdate and a maximumdate(because my
calendartable has limited dateinformation)
and if want to use the lowest date and the highest date in the calendar
table i would have to create a SELECT MIN(Calendar_Dim_Key) FROM
SDM_Calendar and a SELECT MAX(Calendar_Dim_Key) FROM SDM_Calendar in my
FUNCTION.

Every time i call this function it would execute this query twice but
this information is retrieved already is by a former call of this
function. And this irritates me. I want a one call, retrieve the
information and use it multiple times....

An example:

My calendar table ranges from 1980 - 2049 and when the sourcetable has a
date like 01-05-249 the function has to return a 19800101 date (249 <
1980) not 2490501 because this a faulty date.

So i hope it''s now easier to understand. Thanx.

en ja hugo ik ben ook nederlander;-) ik hoop dat dit wat duidelijker is.

Greetz

Hennie

-------------------------------------------------
This is the create script of the calendar table:
-------------------------------------------------
CREATE TABLE [dbo].[SDM_Calendar] (
[Calendar_Dim_Key] [int] NOT NULL ,
[Full_Date_App] [datetime] NOT NULL ,
[Day_of_Month] [tinyint] NOT NULL ,
[Day_of_Year] [smallint] NOT NULL ,
[Day_Full_Name] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
[Week_Number] [tinyint] NOT NULL ,
[Month_Full_Name] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL ,
[Month_Number] [tinyint] NOT NULL ,
[Quarter] [tinyint] NOT NULL ,
[Quarter_Full_Name] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Calendar_Year] [smallint] NOT NULL
) ON [SAMIS_SDM_Index1]
GO
----------------------------------------------
This is the view
-----------------------------------------------
CREATE VIEW TR_Fact_Event_Action1_V
AS
SELECT
Event_Process_Type as Event_Process_Type_Code,
...........
ISNULL(contract_id,''N/A'') as Serv_Contract_Code,
ISNULL(Site_category,''N/A'') as Event_Site_Category_Code,
ISNULL(Cause_Code,''N/A'') as Event_Cause_Code,
ISNULL(Resolution_Code,''N/A'') as Event_Resolution_Code,
..........
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Cl ose_Time,Open_Time))
as FK_Event_Close_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Cl ose_Time,Open_Time))
as FK_Event_Close_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Re open_Time,Open_Time))
as FK_Event_Reopen_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Re open_Time,Open_Time))
as FK_Event_Reopen_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Si te_Visit_Time,Open_Tim
e)) as FK_Event_Site_Visit_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Si te_Visit_Time,Open_Tim
e)) as FK_Event_Site_Visit_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(SL A_Expire_Time,Open_Tim
e)) as FK_Event_SLA_Expire_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(SL A_Expire_Time,Open_Tim
e)) as FK_Event_SLA_Expire_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Re quest_Date,''1990-01-01
00:00:00'')) as FK_Event_Request_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Re quest_Date,''1990-01-01
00:00:00'')) as FK_Event_Request_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Ne gotiate_Date,''1990-01-
01 00:00:00'')) as FK_Event_Negotiate_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Ne gotiate_Date,
''1990-01-01 00:00:00'')) as FK_Event_Negotiate_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(In take_Date,''1990-01-01
00:00:00'')) as FK_Event_Intake_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(In take_Date,''1990-01-01
00:00:00'')) as FK_Event_Intake_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Pl anned_Start_Time,''1990
-01-01 00:00:00'')) as FK_Event_Planned_Start_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Pl anned_Start_Time,''1990
-01-01 00:00:00'')) as FK_Event_Planned_Start_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Pl anned_End_Time,''1990-0
1-01 00:00:00'')) as FK_Event_Planned_End_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Pl anned_End_Time,''1990-0
1-01 00:00:00'')) as FK_Event_Planned_End_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Im plement_Start_Time,''19
90-01-01 00:00:00'')) as FK_Event_Implement_Start_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Im plement_Start_Time,''19
90-01-01 00:00:00'')) as FK_Event_Implement_Start_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Im plement_End_Time,''1990
-01-01 00:00:00'')) as FK_Event_Implement_End_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Im plement_End_Time,''1990
-01-01 00:00:00'')) as FK_Event_Implement_End_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(Ac tion_Open_Time,Open_Ti
me)) as FK_Action_Open_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(Ac tion_Open_Time,Open_Ti
me)) as FK_Action_Open_Time,
xxxxx_Control.dbo.xxxxx_FN_GetDateString(ISNULL(IS NULL(Action_Close_Time
,Close_Time),Open_Time)) as FK_Action_Close_Date,
xxxxx_Control.dbo.xxxxx_FN_GetTimeString(ISNULL(IS NULL(Action_Close_Time
,Close_Time),Open_Time)) as FK_Action_Close_Time,
......
CASE
WHEN Close_Time IS NOT NULL THEN
xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA
(ISNULL(SLA_Expire_Time,Close_Time),
Close_Time,ISNULL(service_schedule,''N/A''),''Y'',''N'')
ELSE 0 END,0) as SLA_Exceed_Closed_Time_Min,
''0'' AS SLA_Exceed_Closed_Time_Min_2,
ISNULL(
CASE
WHEN Resolved_Time IS NOT NULL THEN
xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA (Open_Time,
Resolved_Time,ISNULL(service_schedule,''N/A''),''Y'',''N'')
WHEN Resolved_Time IS NULL AND Close_Time IS NOT NULL THEN
xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA (Open_Time,
Close_Time,ISNULL(service_schedule,''N/A''),''Y'',''N'')
ELSE 0 END,0) as Event_Duration_Resolved_Time_Min,
ISNULL(
CASE
WHEN Close_Time IS NOT NULL THEN
xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA (Open_Time,
Close_Time,ISNULL(service_schedule,''N/A''),''Y'',''N'')
ELSE 0 END,0) as Event_Duration_Closed_Time_Min,
ISNULL(
xxxxx_Control.dbo.xxxxx_FN_GetDiffSLA (Action_Open_Time,
Action_Close_Time,ISNULL(service_schedule,''N/A''),''Y'',''N''),0) as
Action_Duration_Min,
CASE
WHEN Event_Process_Type = ''Call''
THEN DATEDIFF (ss , ''4000-01-01 00:00:00'', call_handle_time) ELSE 0
END as Call_Handling_Sec,
ISNULL(Planned_Hours,0) as Event_Planned_Hours,
ISNULL(Spent_Hours,0) as Event_Spent_Hours,
ISNULL(Remaining_Hours,0) as Event_Remaining_Hours,
ISNULL(sysmodtime,GETDATE()) as Sysmodtime
FROM
SAD_Fact_Event_Action

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


这篇关于还不清楚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆