I've tinkered with the code on some reports to make them give me the information I want and solved a few problems with help from the people on this board. Well, I've created a monster! My boss is now asking me to make some other changes and I'm at a loss.
Report: Sales Tax Analysis
Request: She would like the report to automaticly run for the previous month.
Current Code:
Begin Filter
FieldName = "#ListSalesTaxAnalysis.[Date]"
FilterOp = reportfilteropBetween
FilterLoLim = "8/1/2010"
FilterHilim = "8/31/2010"
FilterNegated = False
FilterConnector = reportfilterbooleanconAND
End Filter
The following things didn't work:
Begin Filter
FieldName = "#ListSalesTaxAnalysis.[Date]"
FilterOp = reportfilteropBetween
FilterLoLim = "Last Month"
FilterHilim = "Last Month"
FilterNegated = False
FilterConnector = reportfilterbooleanconAND
End Filter
OR
Begin Filter
FieldName = "#ListSalesTaxAnalysis.[Date]"
FilterOp = reportfilteropBetween
FilterRange = "Last Month"
FilterNegated = False
FilterConnector = reportfilterbooleanconAND
End Filter
OR
Begin Filter
FieldName = "#ListSalesTaxAnalysis.[Date]"
FilterRange = "Last Month"
FilterNegated = False
FilterConnector = reportfilterbooleanconAND
End Filter
*This post is locked for comments
Meralee,
Based on other posts I've read it sounds like you are not the first to ask this question. I was not able to locate any filters that would accomplish what you are looking to do, but it might be possible to create the report as a Custom report and to remove the filter and have it simply default to always pull the previous month. I tried the following in the SelCriteria section and it looked to pull the correct date range
SelCriteria = "#ListSalesTaxAnalysis.[Date] >= convert(varchar,DATEADD(MONTH,-1,DATEADD(MONTH,DATEDIFF(MONTH,0,getdate()),0)),101) and #ListSalesTaxAnalysis.[Date] <=convert(varchar,DATEADD(MONTH,DATEDIFF(MONTH,0,getdate()),-1),101)"
Hope this might help.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,782 Super User 2024 Season 2
Martin Dráb 229,067 Most Valuable Professional
nmaenpaa 101,150