Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Complex Report (for me)

Author  Topic 

JohnGault777
Starting Member

31 Posts

Posted - 2011-02-21 : 12:11:58
I am new to SQL but I need to develop a fairly complex report out of our system. I'm looking to see the Sale and Quote counts by County for each of the eligible divisions receiving the quote for each week.

Here's the output I'm looking for:


Report for a single week for each Product (3 products): for example: Feb. 19, 2011 – Feb. 25, 2011
County SaleCount QuoteCount SaleCount QuoteCount
(DivisionA) (DivisionA) (DivisionB) (DivisionB)
________________________________________________________
A
B
C
D
E
….etc.

If I could see all three products on the same report that would be awesome. So that would be 12 total columns. Each group of 4 columns would be a new product. In addition, I would like to see all available Counties, even if they didn't receive a quote or sale.

Here are the tables and columns I'm working with.

dbo.Customer
------------------
CustomerID
County
QuoteDate
SaleDate
ProductID

Dbo.Product
------------------
ProductID
ProductType (only 3 products)


dbo.Eligibility
------------------
EligibilityID
CustomerID
OrganizationID


dbo.Organization
------------------
OrganizationID
Division (2 divisions: A and B)


I can pull the information individually, pull it out of SQL and reorganize it to look like the desired output in Excel, but that is way too time consuming.

Can someone help me leap frog my current skill level to develop this type of output?

I just simply do not understand how you generate columns of information based on separate evaluation criteria and display it next to each other.




JG777

JohnGault777
Starting Member

31 Posts

Posted - 2011-02-21 : 12:12:43
Oh, sorry, I'm working in SQL Server 2005.

JG777
Go to Top of Page
   

- Advertisement -