Viewing 15 posts - 2,911 through 2,925 (of 10,144 total)
Have you tried using appropriate date filters on each table?
Something like StorePurchaseDate >= @8.
Posting the actual execution plan of the query with the table insert part commented out might...
September 24, 2014 at 6:49 am
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)
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...
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...
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],
...
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....
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...
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
*/
...
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...
September 12, 2014 at 8:05 am
Another question:
come before
Q07
Q08.
Both of them or either of them?
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...
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...
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...
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)...
September 12, 2014 at 6:17 am
Can you amend that post to use a 24-hour clock please?
September 12, 2014 at 5:45 am
Viewing 15 posts - 2,911 through 2,925 (of 10,144 total)