Viewing 15 posts - 16 through 30 (of 63 total)
Yes, as I was driving to meet a friend for lunch, it dawned on me that I will need to partition by PudID when I include them all. Thanks...
April 20, 2013 at 3:44 pm
Perfect! That's exactly the answer I was looking for. I tried all sorts of SUM OVER PARTITION BY combinations with no luck, but I see the PARTITION wasn't...
April 20, 2013 at 1:37 pm
Hi Chris,
That other post was an attempt to see if I could use some sort of "fast" running balance to calculate blend percentages (variety of grape, vintage of grape, appellation...
April 20, 2013 at 10:41 am
The results I've included in this post are from a query. I've just tried to simplify the issue since I'm really only interested in getting the correct running balance...
April 20, 2013 at 8:54 am
Thanks Jeff. Yes, I want to use the 2012 functionality, but I guess I don't quite understand what you're suggesting. I can create a running total on the...
April 19, 2013 at 5:01 pm
The Plan B query is excrutiatingly slow 🙁
Any suggestions on how I can get the same results but with better performance?
April 17, 2013 at 7:08 pm
OK, I'm trying plan b but the running balance is not correct. It seems to ignore my request for only the highest seq for each lot. I must...
April 17, 2013 at 12:10 pm
Sorry about that. I must've grabbed the wrong file. I've re-uploaded the correct attachment.
April 15, 2013 at 11:46 pm
Thanks for the reply, Lynn. I'm not sure how to replicate the table valued parameter, but I executed the following from SSMS:
BEGIN TRY
SET NOCOUNT ON
BEGIN TRANSACTION
UPDATEAVA...
March 15, 2013 at 3:21 pm
Thanks, Dwain. Let me see what I can do with this.
Gina
January 25, 2013 at 10:06 am
I came up with this code:
selectPntKey,
RowNumber,
CASE
WHEN RowNumber = 1 THEN Qty
ELSE 0
ENDQty,
min(FromDate1),
max(ToDate1),
min(FromDate2),
max(ToDate2)
from
(
selectPntKey,
ROW_NUMBER() OVER(PARTITION BY PntKey ORDER BY PntKey) AS 'RowNumber',
Parent.PntQty Qty,
Child1.Cd1FromDate FromDate1,
Child1.Cd1ToDate ToDate1,
null FromDate2,
null ToDate2
FROM Parent
LEFT JOIN Child1 ON Child1.Cd1PntKey...
November 13, 2012 at 4:41 pm
Thanks for responding. I actually did try using joins as my first choice, but the results were incorrect:
PntKey Qty ...
November 13, 2012 at 9:59 am
The temp table would not be wide enough. I need the ability to calculate running percents on each component in the final product, and often times there are thousands...
February 13, 2012 at 12:44 pm
I just read this article about SQL Server 2012's new features (http://blog.tallan.com/2011/12/08/sql-server-2012-windowing-functions-part-1-of-2-running-and-sliding-aggregates/) and I'm thinking it *might* solve my problem, as long as I can join to other...
February 13, 2012 at 10:50 am
Okay, so because the sparse column actually takes up more space when there is data in it than an equivalent non-sparse column, that would explain why I don't get the...
November 18, 2011 at 10:03 am
Viewing 15 posts - 16 through 30 (of 63 total)