Viewing 15 posts - 31 through 45 (of 50 total)
Thanks Scott,
The problem is that I think there is nothing wrong with my statement. The base function returns keys and dates. It is quite complex but performs very...
March 13, 2018 at 8:00 am
Chris,
Dates are not consecutive. This script transform transactional data into a register. Initial data is contained in two different tables. One contains percentages while the other contains values that will be used to calculate percentages....
May 25, 2017 at 10:11 am
Thanks Luis, I replaced:
SELECT HolderID, EffectiveDate, VotePercentage FROM Q1
UNION ALL
SELECT HolderID, EndDate, 0 FROM Q1
with:
SELECT L.HolderID, C.EffectiveDate, C.VotePercentage
FROM Q1 L
CROSS APPLY (VALUES (L.EffectiveDate, L.VotePercentage), (L.EndDate, 0)) C (EffectiveDate, VotePercentage)
May 25, 2017 at 9:09 am
I tried you statement (I put a TOP 5 to limit the results!) and it does not return StartDate and EndDate, it rather returns the StartDate twice.
May 24, 2017 at 1:39 pm
SELECT * FROM OLD
EXCEPT
SELECT * FROM NEW;
To:
May 18, 2017 at 2:33 pm
Thanks Jacob,
Both old functions and new functions are iTVFs (new functions use CTE). I could send you the plans which are actually complex since the functions are themselves complex....
May 17, 2017 at 2:33 pm
I did update the stats while my statement was oversimplified and it had a positive effect. But with my original statement, the performance remained poor.
November 2, 2016 at 12:42 pm
The plans are quite similar.
The more I am analyzing this, the more it appears to be a SQL Manager Studio issue. I just discovered that if, within Manager Studio, I...
October 11, 2016 at 3:12 pm
I edited and added the comma. Sorry. Current result is
EffectiveDateHolderHQuantityTQuantityPercentage
2001-01-01John 10 10 100
2001-01-02John ...
September 19, 2016 at 11:40 am
J Livingston SQL,
My real data is more complex than the sample data I post with my examples. In the first example you referred to, quantity was the actual sum of...
September 19, 2016 at 11:34 am
Drew,
Sorry, you're right. I over-simplified thinking it would help. Here's something bigger:
INSERT INTO @Transactions (EffectiveDate, Holder, Quantity) VALUES
( '2001-01-01', 'John', 5 ),
( '2001-01-01', 'John', 5 ), --John Holds 100%...
September 19, 2016 at 11:33 am
Everything needed is there in [font="Courier New"]courier new[/font]!
September 19, 2016 at 10:09 am
With the given dataset your solution gives the exact same result. With different datasets I sometimes get slightly different results but I am fixing it as I am learning new...
September 14, 2016 at 1:37 pm
I have 2014 installed on my local computer. My clients have 2008 and up. If the right solution requires some clients to upgrade then it will be done! Thanks.
September 13, 2016 at 1:40 pm
The sample actually includes this case. John has 2 transactions as of 2001-01-01.
September 12, 2016 at 2:33 pm
Viewing 15 posts - 31 through 45 (of 50 total)