与 CRM 相比,MSReport 显示的到期日期晚了 1 天?
MSReport is showing 1 day behind for expiry date, compared to CRM?
目前,当我在 MSReport Builder 上查看保险的到期日部分时,它是 03/04/2017,但我在 CRM 中的保险到期日部分是 04/04/2017,这是正确的,但是在报告中它落后了 1 天,因此我想知道为什么以及解决这个问题的方法是什么?因为我希望它显示与 CRM 04/04/2017 相同,所以我一直在研究并且一些文章说使用 UTC 不以 23 小时开始,不完全确定如何将其放入我的查询中,我是在英国,CRM 选项已经为英国设置,因为我已经检查过了。再次请教解决这个问题?
SELECT 'PAS ' +
SectionName AS SectionName,
SectionKey,
FormName,
ItemName,
ImportSequenceNumber,
ExpiryDate,
ExpiresOn,
@Param_MonthlyStatement_EntityRecordId AS AccountId
FROM
(SELECT
sect.mm_name AS SectionName,
sect.mm_key AS SectionKey,
frm.mm_name AS FormName,
frm.mm_name AS ItemName,
frm.mm_importsequencenumber AS ImportSequenceNumber,
MAX(frmans.mm_expires) AS ExpiryDate,
DATEADD(m, 2, GETDATE()) AS ExpiresOn
FROM Filteredmm_section AS sect INNER JOIN
mm_form AS frm ON sect.mm_sectionid = frm.mm_section INNER JOIN
mm_formanswer AS frmans ON frmans.mm_form = frm.mm_formId INNER JOIN
Account AS acc ON frmans.mm_AccountID = acc.AccountId
WHERE (sect.mm_name LIKE '%-%')
AND (sect.mm_parentsection IS NULL)
AND (CONVERT(NVARCHAR(250), frmans.mm_AccountID)
= @Param_MonthlyStatement_EntityRecordId)
AND ( acc.mm_supplier = 1)
GROUP BY sect.mm_name, sect.mm_key, frm.mm_name, frm.mm_importsequencenumber
HAVING (MAX(frmans.mm_expires) BETWEEN GETDATE() AND DATEADD(m, 2, GETDATE()))) AS t1
WHERE (NOT EXISTS (SELECT TOP (1) mm_accountid FROM Filteredmm_formanswer
WHERE (mm_formname = t1.FormName) AND (mm_accountid = @Param_MonthlyStatement_EntityRecordId) AND (mm_statusname = 'Awaiting Verification')))
ORDER BY SectionName, FormName, ImportSequenceNumber
您可能想从过滤后的 table 中获取到期日期,因为我可以看到使用了过滤,或许可以尝试
INNER JOIN Filteredmm_formanswer AS frmans ON frmans.mm_form = frm.mm_formId
目前,当我在 MSReport Builder 上查看保险的到期日部分时,它是 03/04/2017,但我在 CRM 中的保险到期日部分是 04/04/2017,这是正确的,但是在报告中它落后了 1 天,因此我想知道为什么以及解决这个问题的方法是什么?因为我希望它显示与 CRM 04/04/2017 相同,所以我一直在研究并且一些文章说使用 UTC 不以 23 小时开始,不完全确定如何将其放入我的查询中,我是在英国,CRM 选项已经为英国设置,因为我已经检查过了。再次请教解决这个问题?
SELECT 'PAS ' +
SectionName AS SectionName,
SectionKey,
FormName,
ItemName,
ImportSequenceNumber,
ExpiryDate,
ExpiresOn,
@Param_MonthlyStatement_EntityRecordId AS AccountId
FROM
(SELECT
sect.mm_name AS SectionName,
sect.mm_key AS SectionKey,
frm.mm_name AS FormName,
frm.mm_name AS ItemName,
frm.mm_importsequencenumber AS ImportSequenceNumber,
MAX(frmans.mm_expires) AS ExpiryDate,
DATEADD(m, 2, GETDATE()) AS ExpiresOn
FROM Filteredmm_section AS sect INNER JOIN
mm_form AS frm ON sect.mm_sectionid = frm.mm_section INNER JOIN
mm_formanswer AS frmans ON frmans.mm_form = frm.mm_formId INNER JOIN
Account AS acc ON frmans.mm_AccountID = acc.AccountId
WHERE (sect.mm_name LIKE '%-%')
AND (sect.mm_parentsection IS NULL)
AND (CONVERT(NVARCHAR(250), frmans.mm_AccountID)
= @Param_MonthlyStatement_EntityRecordId)
AND ( acc.mm_supplier = 1)
GROUP BY sect.mm_name, sect.mm_key, frm.mm_name, frm.mm_importsequencenumber
HAVING (MAX(frmans.mm_expires) BETWEEN GETDATE() AND DATEADD(m, 2, GETDATE()))) AS t1
WHERE (NOT EXISTS (SELECT TOP (1) mm_accountid FROM Filteredmm_formanswer
WHERE (mm_formname = t1.FormName) AND (mm_accountid = @Param_MonthlyStatement_EntityRecordId) AND (mm_statusname = 'Awaiting Verification')))
ORDER BY SectionName, FormName, ImportSequenceNumber
您可能想从过滤后的 table 中获取到期日期,因为我可以看到使用了过滤,或许可以尝试
INNER JOIN Filteredmm_formanswer AS frmans ON frmans.mm_form = frm.mm_formId