SSRS Get date from Week Number and day number

Hello Experts Exchange
I am working in SSRS and I want to get the date for the same day last year based on the week number, so for example 27/06/2015 I want to get the same day of the week for last year which would be 28/06/2014.

I have the code that give me the week number.


Open in new window

I have the code that give me the day number.

=DatePart(DateInterval.Weekday, Parameters!SalesDate.Value, FirstDayOfWeek.Sunday)

Open in new window

What I need now is to bring these together to give me last years date, doe anyone know the code I need to make this work?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

SQLSearcherAuthor Commented:
I have found the answer, the code I needed was this;

=DateAdd(DateInterval.Day,Parameters!ReportDay_No.Value -1,
         Parameters!Week_No.Value - 1, 
         DateAdd("d", 1 - DatePart("w",CDate("1/1/" & Parameters!SalesDate.Value.Year-1.ToString())) 
				, CDate("1/1/" & Parameters!SalesDate.Value.Year-1.ToString()))))

Open in new window



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
SQLSearcherAuthor Commented:
Found my own solution.
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

From novice to tech pro — start learning today.