Viewing 15 posts - 2,911 through 2,925 (of 10,143 total)
One hour, the hour before the hour we are in:
SELECT
timeStart = DATEADD(hour,DATEDIFF(hour,0,getdate())-1,0),
timeEnd =DATEADD(hour,DATEDIFF(hour,0,getdate()),0)
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
September 24, 2014 at 5:20 am
-- Since group allocation must take place sequentially row by row, your good options
-- are quite limited. This solution uses a recursive CTE, you could also consider the
-- Quirky...
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
September 23, 2014 at 3:20 am
cnu1252 (9/22/2014)
Thanks for your help
Still facing the same problem.Actually the original query is mentioned below.
changed the column MenuName as NodeTraversed.
First Iam going to mentioned below function which splits...
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
September 23, 2014 at 1:57 am
-- this would help as Grant suggested, however refactoring the whole query
-- to work as a cross-tab would be far more efficient.
SELECT
aa.[AccountID],
aa.[AcctCode],
aa.[AcctName],
aa.[Segment0],
aa.[SegmentName1],
aa.[SegmentShortName1],
...
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
September 12, 2014 at 9:44 am
richardmgreen1 (9/12/2014)
Thanks ChrisI'm going to bookmark this little lot as I'm fairly certain it will come up again (and again, and again).
You're welcome.
I'd recommend you work through the delimitedsplit article....
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
September 12, 2014 at 9:04 am
richardmgreen1 (9/12/2014)
Just to check my understanding of this, it looks like the splitter will help to give each code it's own line number to start with.
Then, the SELECT 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
September 12, 2014 at 8:51 am
Choose how you wish to tackle DaysToCount, round up or down or whatever and incorporate it into the function.
CREATE FUNCTION [dbo].[CountFractionalHolidays]
/*
Put in some explanatory notes here
*/
...
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
September 12, 2014 at 8:19 am
Here you go, Richard. I think you know about Jeff Moden's splitter already:
;WITH SplitData AS (
SELECT *
FROM (SELECT ID = ROW_NUMBER() OVER(ORDER BY (SELECT NULL)), Code FROM #test) t
CROSS...
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
September 12, 2014 at 8:05 am
Another question:
come before
Q07
Q08.
Both of them or either of them?
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
September 12, 2014 at 7:26 am
-- Following on from the last post, here's the same query as above with a couple of amendments.
-- Firstly, I've put the remaining filters into place, the two flag...
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
September 12, 2014 at 7:08 am
richardmgreen1 (9/12/2014)
I've run across a bit of a problem with checking the sequence of codes in a string.
The codes are semi-colon separated in this string, but they are also...
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
September 12, 2014 at 6:38 am
polo.csit (9/12/2014)
Idintno410 0 no(n/a)(n/a)NULL
Titlenvarcharno1000 no(n/a)(n/a)Latin1_General_CI_AS
CompanyNamenvarcharno1000 no(n/a)(n/a)Latin1_General_CI_AS
.
.
.
Index
IX_CompanyNamenonclustered located...
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
September 12, 2014 at 6:34 am
Much better, thank you.
2. The 2nd scenario is the issue I am having which is not covered by the function.
If the start date is on a saturday (Sept 6th)...
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
September 12, 2014 at 6:17 am
Can you amend that post to use a 24-hour clock please?
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
September 12, 2014 at 5:45 am
pwalter83 (9/12/2014)
ChrisM@Work (9/12/2014)
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
September 12, 2014 at 5:03 am
Viewing 15 posts - 2,911 through 2,925 (of 10,143 total)