[thelist] SQL Question - 'Contingent Columns'

Luther, Ron Ron.Luther at COMPAQ.com
Tue Apr 16 08:43:01 CDT 2002


Hi Rudy,


Sorry it wasn't clear - I'll try again:

I'm trying to build a report with a column that says "here's what we shipped MTD thru yesterday" and another column that says "here's what we shipped MTD thru the day before that".  The rows would be part numbers.

[MTD Shipments is a pretty common thing for MFG firms to want to look at.]

e.g.
Part Number --------- Apr 15 --- Apr 14
***************************************
Compaq Red Laptop --- 35,000 --- 32,000
HP Blue Laptop ------ 12,000 ---  8,500


Let's say that on Apr 15, that 35,000 shipment number breaks down as 10,000 from Asia, 13,000 from Europe and 12,000 from the Americas.

At some time this morning, I can see it in my data file as:
Part - Region - Field_1 - Field_2 - Field_3
*******************************************
Red --- AP --- 10,000 --- xxx --- xxx
Red --- EU --- 13,000 --- xxx --- xxx
Red --- NA --- 12,000 --- xxx --- xxx

However, some time this afternoon, that same data will sit in this same file as:

Red --- AP --- xxxxxx --- 10,000 --- xxx
Red --- EU --- 13,000 --- xxxxxx --- xxx
Red --- NA --- 12,000 --- xxxxxx --- xxx

... because 'yesterday' for AP will be different than 'yesterday' for the rest of the world ... and my report still has to add it up correctly - at any time of day.


I need a way to put things back together.


RonL.
(I wish!  No, I think I might have a better chance of getting Madhu to walk over and play "enforcer" with the wizards who came up with this design.  ... and I won't even mention the DBAs who reloaded several million records of data for me last night - before changing the table structure!)


-----Original Message-----
From: rudy [mailto:r937 at interlog.com]

i'm sorry, it's not clear what you're trying to do




More information about the thelist mailing list