Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics RMS (Archived)

Sales Tax Report Filter Question

Posted on by Microsoft Employee

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

  • Suggested answer
    Brian Heery Profile Picture
    Brian Heery 450 on at
    Re: Sales Tax Report Filter Question

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans