Month to Date, Year to Date and Prior Day Totals?

I have to design a report that takes data from a table containg the following fields:

AcctRep (name of the account representative)
AcctNumber (unique # of the account)
DateClosed (datetime field indicating the date the account closed)

I need to show a list of the Account Reps down the left-hand side and a column with totals for accounts closed Year-to-Date, Month-to-Date and Prior Day to the right of their names.

I'm thinking this can be done in a Matrix-style report, but I've been racking my brain for the past few days and just can't seem to make this seemingly simple request work correctly.  I can certainly do separate datasets for each of the summary values (YTD, MTD, Prior Day) but can't get them to display in a nice summary format.

Any thoughts on how to accomplish this?
tpoulosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

manojbp07Commented:
try using a cross tab report
0
dan_masonCommented:
You could create a CTE or temp table that tags each record, and then sum or count them using CASE statements.

The CTE would have clauses like this:

[SELECT]
 
CASE WHEN DATEDIFF(dd,dt,GETDATE())=1 THEN 1 ELSE 0 END AS PriorDay,
CASE WHEN DATEDIFF(mm,dt,GETDATE())=1 THEN 1 ELSE 0 END AS MTD,
CASE WHEN DATEDIFF(yy,dt,GETDATE())=0 THEN 1 ELSE 0 END AS YTD
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSRS

From novice to tech pro — start learning today.