If you are performing more thn your average calculations upon columns, I would recommend using table variables. It creates the ability to store data into a temporary variable that acts just like a table. It does not store the table variable in the tempDB and keeps it active in RAM until it is garbage collected at the end of the execution. It is extremely fast and it allows you to create a loop structure.
Here is a link to show you how: http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=529 Table variables are valid as of SQL Server 2000 and 2005. Teddy On 1/23/07, Robertson-Ravo, Neil (RX) <[EMAIL PROTECTED]> wrote: > > Lol ;-p > > > -----Original Message----- > From: Will Tomlinson [mailto:[EMAIL PROTECTED] > Sent: 23 January 2007 12:26 > To: CF-Talk > Subject: Re: Do I use a view for this? > > Ok I'm getting a handle on things here. Using some T-SQL to do what I was > having CF do. > > My only problem right now is I'm trying to calculate multiple products in > a > given category. This expression is producing an amount that's way too high > for the category. > > SUM((tblConsignmentOrderItems.consignprodstartQTY - > tblConsignmentOrderItems.consignprodendQTY) * > tblConsignmentOrderItems.consignprodprice) > AS catTotal > > This produces 1984.50, and it SHOULD be 283.50. Can't quite figure out how > it's tallying up so much. Any ideas? > > Thanks for all the view info guys! > > Here's the whole SQL statement. Neil, don't say anything bout the non > cfqueryparam'd statement. I'm just testing! lol! > > Will > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267320 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4