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.
| Author |
Topic |
|
ly
Starting Member
6 Posts |
Posted - 2003-09-19 : 07:33:52
|
| Hi everyone please help with this problem:The client database (MS SQL server) contains the following tables:tblBudget, tblTarget, tblActual. The size of the the tables are very large. The fields of the three tables are all in the same way as below and each table contain different data:Country Port Type UnitA A 20’ 4A B 20’ 4B A 20’ 2B B 40’ 22A A 40' 5What's the best way to produce a report as below? The data are the subtotals and totals. buget target actual 20' 40' 20' 40' 20' 40'country A port A 4 55 10 15 null 5port B null 9 null 8 11 6total 4 64 10 23 11 11Country B port A 5 60 11 25 null 8port B 8 9 null null 12 6total 13 69 11 25 12 14 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-09-19 : 08:01:54
|
| please give us some create table statements and some sample data.i.e.,CREATE TABLE Ports (Country char(1), .... etc..)INSERT INTO TABLE PortsSELECT 'a','b',c' UNIONSELECT 'b','c',d' ..etc ...YOu have not given us any infomation on what Budget means, how target is calculated, and what actual is. what are these numbers? Just a little more info and we'll all be glad to help you out ! Remember, we have no knowledge whatsoever of your problem or needs except for what you put in your posts.Please check this out, and look at the thread it references for examples of providing sample data and expected results:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=29090- Jeff |
 |
|
|
|
|
|