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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help required on SQL query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-11 : 11:20:20
Muhammad Owais writes "I have a view as follows:

DEPARTMENT_CODE VARCHAR(5)
ITEM_WAREHOUSE VARCHAR(5)
TOTAL_DEMANDS INTEGER
PRICE INTEGER
DEMAND_DATE DATE


This view displays Total Demands requested on specified date (e.g. BETWEEN 1996-01-01 AND 1996-05-01) by Departments, GROUP BY Warehouse Code and Department Code.

Now I want to generate a query that will return me with the

Dept, Demands_Warehouse (A, B , E), Demands_Warehouse (C, D)
01 11 03
02 05 01
03 00 07
04 00 00
………………..

Can any body help me write this query …"

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-07-11 : 11:45:17
Muhammad Owais - I think some sample data would help us help you much quicker. Any chance?


Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-12 : 02:33:30
You may need to read about Cross-tab Reports in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -