locked
SQL Reporting Query: Return results from CRM for last working week RRS feed

  • Question

  • Hi Guys

    I have been redesigning some of my clients sales reports to show number of Calls completed, Opportunities created and number of Speaks (custom field on Phone calls)

    I have so far been successful using help from here (Shout to Donna!) and I want to tweak the report so that I can be 100% sure it is picking up the right results for number of calls in the last week.

    I had originally tried to incorporate the CRMAF filter on my queries, and although the filter appeared to be changeable, the results I received did not reflect the criteria I had entered.

    So what I resorted to (which appears to work) is including the following SQL in each dataset query
    AND (actualend >= DATEADD(day,   
                          DATEDIFF(day, 0, GETDATE()) - 7, 0)) 
    which returns back the results where actual end is equal to the last 7 days, however that includes the day that the report is run.

    What I want to achieve is the results where the actualend equals the previous working week. 

    I have found a few posts that suggest there is a WW type query but I have been unable to find an explanation as to how I would actually implement this, I am a complete novice with this so would appreciate any assistance!

    Thanks as always

    Allan




    http://allanvirtualitbiz.blogspot.com
    Tuesday, February 24, 2009 5:06 PM

Answers