Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 上个月的SSR,MTD与当月同期_Reporting Services_Ssrs 2008_Ssrs 2008 R2 - Fatal编程技术网

Reporting services 上个月的SSR,MTD与当月同期

Reporting services 上个月的SSR,MTD与当月同期,reporting-services,ssrs-2008,ssrs-2008-r2,Reporting Services,Ssrs 2008,Ssrs 2008 R2,应该很容易吧 今天是2014年8月11日。我想要一个反映MTD的专栏,我有: =Count(IIf(Year(Fields!Date.Value) = Year(Today) And Month(Fields!Date.Value) = Month(Today), Fields!ID.Value, Nothing), ) 但我也希望在SSRS上有一个专栏,向我展示上个月(2014年11月7日)的相同时间框架 我可以把日期显示出来,但我一辈子都搞不懂如何像抓取当月数据那样抓取数据 =Forma

应该很容易吧

今天是2014年8月11日。我想要一个反映MTD的专栏,我有:

=Count(IIf(Year(Fields!Date.Value) = Year(Today) And Month(Fields!Date.Value) 
= Month(Today), Fields!ID.Value, Nothing), )
但我也希望在SSRS上有一个专栏,向我展示上个月(2014年11月7日)的相同时间框架

我可以把日期显示出来,但我一辈子都搞不懂如何像抓取当月数据那样抓取数据

=FormatDateTime(DateSerial(DatePart("yyyy",today()), DatePart("m",today())-1, 
 DatePart("d",today())), DateFormat.ShortDate)

第二列公式类似于=Count(IIf(年(字段!Date.Value)=年(今天().AddMonths(-1))和月(字段!Date.Value)
=Month(今天().AddMonths(-1))和DatePart(“d”,Fields!Date.Value)不能100%确定问题是什么。您是指用字段替换“Today()”函数吗?
=FormatDateTime(DateSerial(DatePart(“yyyy”,Fields!Date.Value),DatePart(“m”,Fields!Date.Value)-1,DatePart(“d”,Fields!Date.Value)),DateFormat.ShortDate)
您是说要比较同一时间段内当前MTD总额与之前的MTD总额。又名“上个月这个时候我过得怎么样?”@lethaljd,是的。我想看看这个月与上个月同一时间相比我过得怎么样。