Viewing 2 posts - 10,141 through 10,143 (of 10,143 total)
Hi
Here's another way using Jeff's data (thanks Jeff)
-- collect only the rows we're interested in
SELECT IDENTITY (int, 1, 1) AS RowID, *, CAST(0 AS int)...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 30, 2007 at 4:59 am
Hi Chris
This should do the trick.
CREATE TABLE #MSG369550 (AccountDate DATETIME, parent CHAR(6), RecordCode CHAR(11), AccountName CHAR(5), Quantity INT)
INSERT INTO #MSG369550 VALUES ('12/31/2002','PARENT','RECORDCODE1','ACCT1',10000)
INSERT INTO #MSG369550 VALUES ('01/31/2003','PARENT','RECORDCODE1','ACCT1',12000)
INSERT...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 29, 2007 at 9:40 am
Viewing 2 posts - 10,141 through 10,143 (of 10,143 total)