November 25, 2011 at 7:09 am
When i try to create report using report wizard i get empty report. What all the correct setting.
i am using below query to generate report
WITH C AS
(
SELECT YEAR(OrderDate) AS OrderYear,
AVG(TotalDue) AS TotalDue
FROM Sales.SalesOrderHeader
GROUP BY YEAR(OrderDate)
)
SELECT
Cur.TotalDue AS CurrentTotalDue
,Cur.OrderYear AS OrderYear
,Pre.TotalDue AS PreviousTotalDue
,Cur.TotalDue-Pre.TotalDue AS TotalDueForTheYear
FROM C Cur
LEFT OUTER JOIN C Pre
ON Cur.OrderYear=Pre.OrderYear+1
ORDER BY OrderYear ASC
what could be the problem?
Environment: Windows 2008 Server,64bit, Sq l server 2008
November 25, 2011 at 7:25 am
Smash125 (11/25/2011)
When i try to create report using report wizard i get empty report. What all the correct setting.i am using below query to generate report
WITH C AS
(
SELECT YEAR(OrderDate) AS OrderYear,
AVG(TotalDue) AS TotalDue
FROM Sales.SalesOrderHeader
GROUP BY YEAR(OrderDate)
)
SELECT
Cur.TotalDue AS CurrentTotalDue
,Cur.OrderYear AS OrderYear
,Pre.TotalDue AS PreviousTotalDue
,Cur.TotalDue-Pre.TotalDue AS TotalDueForTheYear
FROM C Cur
LEFT OUTER JOIN C Pre
ON Cur.OrderYear=Pre.OrderYear+1
ORDER BY OrderYear ASC
what could be the problem?
Environment: Windows 2008 Server,64bit, Sq l server 2008
My car is broken, it's a red one. Difficult to fix with that description, isn't it? ๐
When you have time, please read this article[/url] about the best way to provide us with working sample data and DDL scripts.
Thanks.
November 25, 2011 at 7:33 am
Fairly simple steps i have given.
November 25, 2011 at 7:39 am
Smash125 (11/25/2011)
Fairly simple steps i have given.
OK, I'm going to paraphrase an article for you.
Am I wearing a hat?
Take a few minutes, think about it, write it down on a piece of scrap paper. I can wait, take your time...
What's that, you say? You can't answer that simple question!? Why not? I stated it very clearly, it requires a simple YES or NO response, there's nothing tricky there. So, why would anyone have any trouble giving an answer to something so basic and simple?
You have no way of knowing what I am wearing because I did not provide you enough information!
The same applies to what you've asked. The issue could be that your query is incorrect. It could be that your SSRS is set-up incorrectly. It could be that you're pointing your query at the wrong database. It could be any number of things, but without information from you there is no way to answer.
Obviously it's entirely up to you whether or not you want to provide all of the information required to answer your question. If you choose not to, maybe someone with more patience will happen by and slowly drag the information out of you post by post, but I suspect you'll leave here frustrated and disappointed.
November 25, 2011 at 7:42 am
Run this query, describe the result set - better still, post the result set:
SELECT YEAR(OrderDate) AS OrderYear,
AVG(TotalDue) AS TotalDue
FROM Sales.SalesOrderHeader
GROUP BY YEAR(OrderDate)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply