[英]How to retrieve current month in SSRS expression
I want to get current month as default value of a parameter. 我想获取当前月份作为参数的默认值。 I've come up with (which does not work):
我想出了(这不起作用):
=Month(Now())
If you want to get the month as an int that goes from 1 to 12, you can use this 如果您希望将月份作为从1到12的整数,则可以使用此
SELECT MONTH(GETDATE())
This answer was based on the official documentation that you can see in here - http://technet.microsoft.com/en-us/library/ms187813.aspx 该答案基于您可以在此处查看的官方文档-http://technet.microsoft.com/zh-cn/library/ms187813.aspx
Edit 编辑
For reporting services specifically, you can use 对于报告服务,您可以使用
MonthName(NOW())
This will return a month name and i believe is the function you're looking for. 这将返回一个月份的名称,我相信这是您要查找的功能。
Or, in case you want the month as an integer, try using 或者,如果您希望月份为整数,请尝试使用
Month(TODAY())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.