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 –
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 –