Viewing 15 posts - 1,291 through 1,305 (of 10,143 total)
This -
select top(185) EoMonth('1/1/2016',(1-n)) as Eom from tally
- using Bob's tally view covers roughly 2000 to 2016, the entire range of dates in my table of interest.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 12, 2016 at 9:55 am
Lynn Pettis (8/12/2016)
Steve Jones - SSC Editor (8/12/2016)
Lynn Pettis (8/11/2016)
Having rules for answering questions makes sense but I have to ask the question, Why? Has as been noted there...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 12, 2016 at 9:40 am
The Dixie Flatline (8/12/2016)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 12, 2016 at 9:34 am
The Dixie Flatline (8/12/2016)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 12, 2016 at 7:33 am
Steve Jones - SSC Editor (8/11/2016)
Part of the process noted that we have a few "how to post code, how to ask a question, how to format code" articles. We...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 12, 2016 at 3:48 am
Thanks.
The UPDATE affects the PK. Is this PK referenced by FK constraints in other tables? If so, are they indexed?
Edit: or it would, if there were any rows affected...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 10:02 am
Jeff Moden (8/11/2016)
ben.brugman (8/11/2016)
Eric M Russell (8/11/2016)
"If you break a few eggs, then make an omelet."
Christopher Columbus,... challenges his critics to make an egg stand on its tip. After...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 8:17 am
DROP TABLE #temp;
WITH cte as (
select 1 AS ID, 'x' as Item union all
select 2, 'x' union all
select 3, 'x' union all
select 4, 'x' union all
select 5, 'A' union all
select...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 7:08 am
mitch 14804 (8/11/2016)
Hi Chris,
Thanks for the feedback. The reasoning behind my long process is so I could put it in a view not a procedure. It now allows...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 6:56 am
There's currently no column to set the order of these rows. Without one, SQL Server will not guarantee that the rows will be processed (output) in any specific order. A...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 6:43 am
The results I get are much closer than that, John (except for Kevin's).
This might be the simplest option:
SELECT
Adj_CheckDate,
cnt = COUNT(*)
FROM trans t
CROSS APPLY (SELECT ldom = EOMONTH([date]),...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 6:08 am
TheSQLGuru (8/11/2016)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 5:35 am
twin.devil (8/11/2016)
Here is Chris updated script:
SELECT
t.[Check_date],
cnt =...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 4:48 am
SELECT
t.[Date],
cnt = COUNT(*)
FROM Trans t -- 36M rows
CROSS APPLY (SELECT ldom = DATEADD(MONTH,1+DATEDIFF(MONTH,0,t.[Date]),0)-1) x
WHERE DAY([Date]) > 27
AND t.[Date] = x.ldom
GROUP BY t.[Date]
-- (100 row(s) affected) /...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 3:51 am
cmullen77 29296 (8/10/2016)
That was my point.. I had an issue running an update statement, so I started eliminating rows to figure out what was causing my problem. ...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 11, 2016 at 2:04 am
Viewing 15 posts - 1,291 through 1,305 (of 10,143 total)