0
我的問題正在逐漸變得越來越困難,很明顯,你正在教我好! 在這一個我有一個報告,打印卡確認的細節。 除了當我將確認請求更改爲「週轉請求」時,所有字段都可以正常填寫,但在CTYlong中沒有出現的字段對於「週轉請求」的所有實例都是空白的。這是用於ssrs 我會給你!字段沒有顯示在報告部分
IF @MsgType = 200
BEGIN
SELECT DISTINCT MsgType = 'confirm Request' , resp.dtTimeRPO as HostTime ,
resp.sSTANExternalI as STAN ,
resp.sterminal_TerminalID as TerminalID , resp.ssell_CardAcceptorIDCode as
sellID , resp.ssell_CardAcceptorNameLoc as sellName ,
STUFF(resp.span_Pan,7,(LEN(resp.span_Pan)-10), REPLICATE('X',(LEN(resp.span_Pan)-10)))
as PAN , CAST(MONTH(resp.dtpan_ExpiryDate) as varchar(2)) + '/' +
CAST(YEAR(resp.dtpan_ExpiryDate) as char(4)) as ExpDate , CAST(resp.namounts_cAmount
as float)/100 as Amount , resp.namounts_CurrencyCodetx as CurrencyCode ,
resp.nActionCode as RC , rc.rcInfo as RCDesc , resp.sconfirmCode as confirmCode ,
ssell_CountryShort2 AS sell_Country , ctylong ,
(SELECT DATEPART(ss, resp.dtTimeRPO - req.dtTimeRQI) FROM dbo.txHistory as
req (NOLOCK)
WHERE req.sSTANExternalI = resp.sSTANExternalI
AND
req.namounts_cAmount = resp.namounts_cAmount
AND req.dtLocalDateTime = resp.dtLocalDateTime
AND RTRIM(req.sPHProfile) = @Head
AND (req.sconfirmCode = ''
AND req.nActionCode = 0)
AND req.dtTimeRQI BETWEEN DATEADD(mi, -1, @StartDate)
AND @EndDate) as Duration
FROM dbo.txHistory as resp (NOLOCK)
INNER JOIN dbo.replyCode as rc (NOLOCK)
ON resp.nActionCode = rc.rcCode
inner join country (nolock)
on nsell_countrycode = ctycode
WHERE resp.dtTimeRPO
BETWEEN @StartDate AND @EndDate
AND
resp.eMTI = @MsgType
AND
RTRIM(resp.sPHProfile) = @Head
AND NOT (resp.sconfirmCode = '' AND resp.nActionCode = 0)
ORDER BY resp.dtTimeRPO
END
ELSE
BEGIN
SELECT DISTINCT MsgType = 'turnaround Request' , resp.dtTimeRPO as HostTime ,
resp.sSTANExternalI as STAN , resp.sterminal_TerminalID as TerminalID ,
resp.ssell_CardAcceptorIDCode as sellID , resp.ssell_CardAcceptorNameLoc
as sellName , STUFF(resp.span_Pan,7,(LEN(resp.span_Pan)-10), REPLICATE('X',
(LEN(resp.span_Pan)-10))) as PAN , CAST(MONTH(resp.dtpan_ExpiryDate) as varchar(2)) +
'/' + CAST(YEAR(resp.dtpan_ExpiryDate) as char(4)) as ExpDate ,
CAST(resp.namounts_cAmount as float)/100 as Amount ,
resp.namounts_CurrencyCodetx as CurrencyCode , resp.nActionCode as RC ,
rc.rcInfo as RCDesc , resp.sconfirmCode as confirmCode ,
(SELECT DATEPART(ss, resp.dtTimeRPO - req.dtTimeRQI)
FROM dbo.txHistory as req (NOLOCK)
WHERE req.sSTANExternalI = resp.sSTANExternalI AND req.namounts_cAmount =
resp.namounts_cAmount AND req.dtLocalDateTime = resp.dtLocalDateTime
AND
RTRIM(req.sPHProfile) = @Head
AND
(req.eMTI = 420 AND req.nActionCode = 400)
AND
req.dtTimeRQI BETWEEN DATEADD(mi, -1, @StartDate) AND @EndDate)
as Duration
FROM dbo.txHistory as resp (NOLOCK)
INNER JOIN dbo.replyCode as rc (NOLOCK) ON resp.nActionCode = rc.rcCode WHERE
resp.dtTimeRPO
BETWEEN
@StartDate
AND @EndDate AND resp.eMTI = @MsgType
AND RTRIM(resp.sPHProfile) = @Head
ORDER BY resp.dtTimeRPO END