简体   繁体   English

SSRS表达将持续12个月

[英]SSRS Expression to Get last 12 months

I have created a ssrs report and this report display last 12 months data. 我创建了一个ssrs报告,该报告显示最近12个月的数据。 I have 2 parameters startDate and Enddate. 我有2个参数startDate和Enddate。 The End date is always the current month and I want the start date to be the last 12 months. 结束日期始终是当前月份,我希望开始日期是过去12个月。 For example if my (End Date) current month is JAN 2018. I want my start date to be Feb 2017. I have below expression but this give me Jan 2017 date for my start date. 例如,如果我的(结束日期)当前月份是2018年1月。我希望我的开始日期是2017年2月。

=DateAdd("M", -12,Today()) = DateAdd(“ M”,-12,Today())

Try this expression for the start date parameter default value. 尝试使用此表达式作为开始日期参数的默认值。

=DateAdd(DateInterval.Year, -1, DateAdd(DateInterval.Month, 1, Parameters!EndDate.Value))

Here's what the parameter values would equal: 参数值等于:

在此处输入图片说明

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

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