Viewing 3 posts - 1 through 3 (of 3 total)
srienstr (5/13/2008)
Don't bother with the loop at all, substitute in a join.
----Segment Level Supply
INSERT INTO @ConversionTesting(Quarter, Source, Segment, Metric,Value)
select Q.Quarter, 'Converted' as Source, MarketsegmenttypeCode, 'Inventory', sum(NumUnits)
from dbo.tbl_BldgSegments bs
...
May 13, 2008 at 12:07 pm
Declare @ConversionTesting TABLE
(
[Quarter] [smalldatetime] NOT NULL,
Source varchar(25),
[MSA] [nvarchar](255),
MSA_Code int,
[Segment] [nvarchar](255),
[Metric] [nvarchar](255),
[Value] [float] NULL
)
Declare @DistinctQuarters TABLE
(
ID int IDENTITY,
Quarter datetime
)
INSERT INTO @DistinctQuarters(Quarter)
SELECT distinct QuarterEndDate
from tbl_Conversion
order by QuarterEndDate
DECLARE @QuarterEndDate Datetime
DECLARE @iNextRowID int,...
May 13, 2008 at 9:42 am
OK, I clearly don't understand how to use the formatting since it doesn't seem to be working for me, so I've removed it. Pretty sad for a programmer. ...
May 13, 2008 at 9:06 am
Viewing 3 posts - 1 through 3 (of 3 total)