【问题标题】:Formula to answer the "was this ticket still open on April 30th 2015" in Crystal Reports在 Crystal Reports 中回答“这张票在 2015 年 4 月 30 日是否仍然开放”的公式
【发布时间】:2015-08-21 22:27:17
【问题描述】:

我正在使用的数据是

INC#  Client   Summary     Opened Date     Closed Date  
1     user A   Issue 1      12/18/2006     07/03/2015  
2     user B   Issue 2      04/01/2015     07/02/2015  
3     user C   Issue 3      05/04/2015     05/06/2015 

我想生成一份报告,显示每个月底我们的队列中有多少未处理的票。我需要一个公式来回答“这张票在 2015 年 4 月 30 日是否仍然开放”的问题,然后显示计数

现在我正在从 Track-IT 提取我们所有的门票! 9 已经并且刚刚在 Crystal 报表 XI 中过滤掉了 subTickets。

【问题讨论】:

  • 现在我的 SQL 看起来像这样 SELECT "TASKS"."WO_NUM", "TASKS"."REQUEST", "TASKS"."TASK", "TASKS"."OPENDATE", "TASKS "."CLSDDATE", "TASKS"."RESPONS" FROM "TRACKIT9_DATA"."dbo"."TASKS" "TASKS" WHERE ("TASKS"."OPENDATE"={ts '2015-09-01 00:00:00'} OR "TASKS"."CLSDDATE" IS NULL ) ORDER BY "TASKS"."RESPONS", "任务“。”打开“

标签: sql crystal-reports remedy


【解决方案1】:

这个 sql 脚本可能会有所帮助

declare @endOfMonths table(endDay datetime);
insert into @endOfMonths values('2015-01-31');
insert into @endOfMonths values('2015-02-28');
insert into @endOfMonths values('2015-03-31');
... -- you may insert these dates within a loop also

select count(*), endDay 
from dataTable
inner join @endOfMonths on endDay between OpenedDate and ClosedDate
group by endDay
order by endDay

【讨论】:

    猜你喜欢
    • 2015-07-11
    • 2011-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多