SSRS Expression IIF

0
请教怎么用IIF Expression把datarange parementer里面的‘1900-01-01’换成'Present'?

W06.jpg

 
已邀请:
0

- 取是能力,舍是境界 2016-05-23 回答

把你DataSet中的SQL贴出来,如果这个是在参数中用表达式拼的,那就把表达式贴出来。
0

wenti 2016-05-23 回答

SQL query:
CREATE TABLE Temp14_Product
(ProductID INT,
ProductDescription VARCHAR(20));

INSERT INTO Temp14_Product
VALUES
(1,'Calculator'),
(2,'Cabinet'),
(3,'Chair');

CREATE TABLE Temp14_Plan
(ProductID INT,
EffectiveStartDT DATETIME,
ProductPrice MONEY);

INSERT INTO Temp14_Plan
VALUES
(1,'2013-06-04',15.25),
(1,'2013-06-17',16.33),
(1,'2014-06-25',16.45),
(1,'2014-02-23',16.65),
(2,'2013-05-01',42.13),
(2,'2013-08-09',45.88),
(2,'2013-08-10',45.85),
(3,'2013-12-31',22.75);

SELECT PP.ProductID
,P.ProductDescription
,PP.ProductPrice
,PP.EffectiveStartDT
,EffectiveEndDT=LEAD(EffectiveStartDT,1) OVER(PARTITION BY PP.ProductID ORDER BY EffectiveStartDT)
FROM Temp14_Plan AS PP,Temp14_Product AS P
WHERE PP.ProductID=P.ProductID
ORDER BY ProductID

SELECT PP.ProductID
,P.ProductDescription
,PP.ProductPrice
,PP.EffectiveStartDT
,EffectiveEndDT=LEAD(EffectiveStartDT,1,'1900-01-01') OVER(PARTITION BY PP.ProductID ORDER BY EffectiveStartDT)
FROM Temp14_Plan AS PP,Temp14_Product AS P
WHERE PP.ProductID=P.ProductID

要回复问题请先登录注册