简体   繁体   English

本年一月最后一天的表达式

[英]Expression For Last Day of January in Current Year

I want to know what expression what I use to find specifically the last day of the month of January for the current year. 我想知道我要用什么表达来具体查找本年一月的最后一天。 Can anybody help me with this specific expression in SSRS? 有人可以帮我解决SSRS中的这种特定表达吗? Trying to use for a parameter value. 尝试使用参数值。

Thanks! 谢谢!

That can be as simple as something like this: 可以像这样简单:

=CDate("1/31/" & DatePart(DateInterval.Year, Today))

You may need to change this a bit depending on the date format of where you live. 您可能需要根据居住地的日期格式进行一些更改。 This one above would be fine anywhere in the US. 以上在美国任何地方都可以使用。

=CDate("31/01/" & DatePart(DateInterval.Year, Today)) 

This one could be best for Europe. 这可能是最适合欧洲的。

=CDate(DatePart(DateInterval.Year, Today) & "-01-31")

Above works, too. 以上也行。

Play around with the idea. 试一下这个想法。 Hope this helps. 希望这可以帮助。

We know that the last day of the January is the 31st day of the Year. 我们知道一月的最后一天是一年中的第31天。 I am not sure if you are specifically asking for the date or the weekday name. 我不确定您是否明确要求输入日期或工作日名称。 So below are the expressions you can use. 因此,下面是您可以使用的表达式。

Date of the last day of January for current year: (01/31/2017) 本年一月最后一天的日期:(01/31/2017)

=DateAdd("d",-DatePart(DateInterval.DayOfYear,Today,0,0)+31,Today)

Weekday of the last day of January for current year: (3) 当年1月最后一天的工作日:(3)

=Weekday(DateAdd("d",-DatePart(DateInterval.DayOfYear,Today,0,0)+31,Today))

WeekdayName of the last day of January for current year: (Tuesday) 星期几本年一月的最后一天的名称:(星期二)

=WeekdayName(Weekday(DateAdd("d",-DatePart(DateInterval.DayOfYear,Today,0,0)+31,Today)))

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

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