I am trying to put together an aggregation table for some reporting. So far, I 
have a query that looks something like this:

DECLARE @MyID INT,
                @ReportDate datetime
SET             @MyID = 1
SET             @ReportDate = '2007-12-01'
UPDATE  rptMyDays
SET     
                NumItems = (
                        ... (uses @MyID)
                ),
                NumEvents = (
                        ... (uses @MyID)
                )
WHERE   MyID = @MyID 
        AND     ReportDate = @ReportDate

I would like to build a row in this table for every row in another table that 
matches a certain criteria (it hasn't been logically deleted, basically). So, 
@MyID would change for each row in the other table.

Am I missing an easy way to do this or would this require cursors or is it just 
time to use an OLAP cube?

Thanks,

Steve 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294170
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to