Viewing 15 posts - 706 through 720 (of 1,419 total)
Ok, Category appears to not be a reserved word and appears in white. Period and Value are both blue. So it's brackets, no brackets, and brackets instead of brackets, brackets,...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 22, 2021 at 2:53 pm
To subtract the values the rows would need to be joined in some way. Since maybe some Category(ies) is/are not always present for each Period you could try OUTER APPLY...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 22, 2021 at 12:24 pm
Like what Mr Brian Gale described you could try a combination of LEAD and LAG functions
with lead_lag_cte as (
select *,
...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 19, 2021 at 11:51 pm
Interesting news. Thank you. Please reach out if there's anything I could do that might help. Regarding the forum there was never a UI built so it's currently DDL, SQL...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 19, 2021 at 8:15 pm
That's really awesome Steve. I know a lot of people are going to be happy you've picked up the ball with this and in this way too. That's awesome. It's...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 19, 2021 at 6:33 pm
It was very quick, and I knew about it yesterday, but didn't really do much other than give a vote to try. Still amazed it happened.
Comments, suggestions,...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 19, 2021 at 3:03 pm
What needs to be dynamic?
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 19, 2021 at 11:38 am
Maybe something like this
with part_cte as (
select PartId,
sum(case when CodeType=1885 then 1...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 18, 2021 at 9:50 pm
Yes it could be put in the same function
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 18, 2021 at 11:16 am
Wow, that is so much faster. Thank you Steve. Now let me take a look to understand the code, is it the fnTally make it so much faster?
It's true...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 17, 2021 at 6:31 pm
I will give it a try, so the fnTally is the one I can copy here? thanks
https://www.sqlservercentral.com/scripts/create-a-tally-function-fntally
That's the one I use. There are others out there and if you're...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 17, 2021 at 4:42 pm
It seems the query is performing a partial cross join. The cross join could be replaced by a tally function and window (rows between 30 preceding and current row)...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 17, 2021 at 2:21 pm
It seems safest to COUNT(DISTINCT CATEGORY) with GROUP BY PartId. It's not clear if it's necessary to join back to the table to SELECT other CategoryIds. If other CategoryIds (than...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 15, 2021 at 9:22 pm
Suppose there's a table of weekend workdays with "Makeup day after St. Patricks Day" in it. The weekend workday(s) could be included in the query using OR EXISTS and a...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 14, 2021 at 3:58 pm
Suppose there's a table of holidays with St Patrick's Day in it. The holiday(s) could be excluded in the query using WHERE NOT EXISTS and a correlated subquery. Because St...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
March 12, 2021 at 9:23 pm
Viewing 15 posts - 706 through 720 (of 1,419 total)