简体   繁体   English

当前系统日期的YEAR部分的SSRS BIDS 2008表达式

[英]SSRS BIDS 2008 Expression for YEAR part of current system date

Does anyone know what the expression is to take the YEAR only from the current date in SSRS BIDS 2008. I need this as I have a table grouped on multiple years and I want to FILL the current year in green and leave the rest white. 有人知道SSRS BIDS 2008中仅从当前日期开始的YEAR的表达是什么。我需要这样做,因为我有一个按年份分组的表,我想用绿色填充当前年份,而将其余年份保留为白色。

I am going to use the following expresssion (minus the current year part) 我将使用以下表达形式(减去当前年份部分)

=iif(Fields!Date_year.Value=" _ __ _ _ ","SeaGreen","White") = iif(Fields!Date_year.Value =“ _ __ _ _ ”,“ SeaGreen”,“ White”)

Can anyone help me with this? 谁能帮我这个?

I think he means like this... 我想他的意思是这样...

Iif( Year(Fields!Date_year.Value) = Year(NOW), "SeaGreen", "White")

he wants the year bit dynamic. 他希望这一年充满活力。

If the Date_year bit equals the current year then show it in SeaGreen ???? 如果Date_year位等于当前年份,则以SeaGreen显示它?

我的解决方案:

=iif(Fields!Date_year.Value= Year(NOW) ,"SeaGreen","White")

If your field has a date datatype, you can use the Year() function, like so: 如果您的字段具有日期数据类型,则可以使用Year()函数,如下所示:

Iif( Year(Fields!Date_year.Value) = 2011, "SeaGreen", "White")

If the field has a string datatype, you can convert it to a date first, using the DateTime.Parse() function. 如果该字段具有字符串数据类型,则可以使用DateTime.Parse()函数将其首先转换为日期。

Reading material: 阅读材料:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM