Help needed with getting data out a running sum table.

R

r.puffette

Hi,

I need to create a query to analize the data into individual
production segments. The data below is held in a running sum format
i.e. 9313.884 produced on Seg 1, then 0 produced from Seg 2-6 and then
19359.9-9313.884 i.e. 10046.016 produced against seg 7. I really want
to replace the data in Linear with the actual run amount, but I am
having real difficulty.

Clink Seg SegmentReason Setup Linear RunTime
129952 1 872301 9313.884 22/06/2007 00:39:45
129952 2 Shift change 872301 9313.884 22/06/2007 03:00:00
129952 3 Shift change 872301 9313.884 22/06/2007 07:00:00
129952 4 Shift change 872301 9313.884 23/06/2007 02:00:00
129952 5 Shift change 872301 9313.884 23/06/2007 17:00:00
129952 6 Shift change 872301 9313.884 24/06/2007 08:00:00
129952 7 Shift change 872301 19359.9 25/06/2007 07:00:00

Can any one help ?

Many Thanks

Richard
 
K

KARL DEWEY

Try this ---
SELECT puffette.Clink, puffette.Seg, puffette.SegmentReason, puffette.Setup,
puffette.Linear, puffette.RunTime, [puffette].[Linear]-[puffette_1].[Linear]
AS [Production Run]
FROM puffette INNER JOIN puffette AS puffette_1 ON puffette.Clink =
puffette_1.Clink
WHERE (((puffette_1.Seg)=[puffette].[Seg]-1));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top