CALCULATION

M

mbynoe

Could someone please execute this SQL statement into Access?

CREATE TABLE #tmp

( RowID INT IDENTITY(1,1) NOT NULL,

Injection NUMERIC(16,4) NOT NULL,

WidthDrawl NUMERIC(16,4) NOT NULL,

Inventory NUMERIC(16,4) NULL)





INSERT INTO #tmp

(Injection, Widthdrawl)

VALUES (0, 0) --5504.8



INSERT INTO #tmp

(Injection, Widthdrawl)

VALUES (16.4, 0)



INSERT INTO #tmp

(Injection, Widthdrawl)

VALUES (60.8, 0)



INSERT INTO #tmp

(Injection, Widthdrawl)

VALUES (61.1, 0)



INSERT INTO #tmp

(Injection, Widthdrawl)

VALUES (63.1, 0)



INSERT INTO #tmp

(Injection, Widthdrawl)

VALUES (60.7, 0)



select * from #tmp



SELECT t1.*, ISNULL(t1.Inventory, 5504.8) + t1.Injection - t1.
Widthdrawl

FROM #tmp t1 -- Start

JOIN #tmp t2 -- End

ON t1.RowID = t2.RowID –
 

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