Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Pivot CRM Report using SSRS

Posted on by 270

Hi guys below is my query that filter my data correctly but i fail to pivot it correctly. This is for report that i want to run in my crm 2015 version

SELECT
AH.customername,
AH. accountdate,
AH. revenue,
EA.AccountNumber,
DATENAME(month, AH.accountdate) As AccountMonth,
DATEADD(year,-1,(dateadd(month, datediff(month, -1, getdate()) - 1, -1) + 1)) AS StarDate
FROM
Filteredaccounthistory AH
INNER JOIN Account EA ON EA.Customer = AH.customer

WHERE AH.accountdate>= DATEADD(year,-1,(dateadd(month, datediff(month, -1, getdate()) - 1, -1) + 1))
AND AH.accountdate<= dateadd(month, datediff(month, -1, getdate()) - 1, 1)
AND DATEDIFF(month,DATEADD(year,-1,(dateadd(month, datediff(month, -1, getdate()) - 1, -1) + 1)), dateadd(month, datediff(month, -1, getdate()) -1, 1)) =12

ORDER BY AH.customername ASC

currently im getting:1121.current.PNG

and I want to archive this:goal.PNG

I will appreciate your help

*This post is locked for comments

  • Verified answer
    EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: Pivot CRM Report using SSRS

    Look at below link.

    technet.microsoft.com/.../ms177410%28v=sql.105%29.aspx;

  • Verified answer
    EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: Pivot CRM Report using SSRS

    Put the same question on Sql Server forum,

    you will get the answer.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans