Viewing 15 posts - 2,236 through 2,250 (of 10,144 total)
-- Sure, just remove ActType and Points from the GROUP BY...
SELECT
h.[hours],
Activities = COUNT(a.ActType),
Points = SUM(x.points)
FROM #tblActivities a
CROSS APPLY (
SELECT
[hours] = CASE
WHEN a.ActType = 'Motion' THEN DATEPART(HOUR,...
August 20, 2015 at 4:47 am
-- expand this repeating sequence to cover the maximum number of sales by customer
SELECT
CustomerID,
SaleDate1 = MAX(CASE WHEN rn = 1 THEN SaleDate ELSE NULL END),
Location1 = MAX(CASE WHEN rn...
August 20, 2015 at 2:23 am
serviceaellis (8/19/2015)
DECLARE @yr AS int;
SET @yr = 2015;
which is used in
WHERE (YEAR(EndDate) = @yr)
...
August 20, 2015 at 2:11 am
dudekula.kareemulla (8/19/2015)
I got your point but here situation may be swipe-in and swipe-out machines are separate and
new joiners may be confused and done instead of...
August 20, 2015 at 2:00 am
Jeff Moden (8/20/2015)
August 20, 2015 at 1:57 am
coolchaitu (8/20/2015)
There is remote join in the query you posted. I came across an article that says Remote join doesn’t work well on SQL server 2005. Ours is...
August 20, 2015 at 1:46 am
In case this spills past UK time, this is what I have so far:
DECLARE @lobid INT = 3,@LineOfBusiness VARCHAR(50)='ECN'
DECLARE @CmsContractID VARCHAR(MAX)='H9285'
SELECT DISTINCT D.DeterminantID AS BEN_CAT_ID
,DENSE_RANK() OVER...
August 19, 2015 at 9:02 am
Eric M Russell (8/19/2015)
squvi.87 (8/19/2015)
...
Yes it produces correct result only, it took 30 mins. If I remove the [SplitString] part from the query it took only 5-10 seconds.
OUTER APPLY (
SELECT...
August 19, 2015 at 8:59 am
serviceaellis (8/19/2015)
ChrisM@Works,The columns except the last four columns which are:
MembershipTypeIdEndDateInvoiceNumberPersonMembership_PersonId
Thanks. What about the content? What do the results tell you?
August 19, 2015 at 8:38 am
Luis Cazares (8/19/2015)
Have you considered changing your splitter function to a faster one?Here's probably the fastest available: http://www.sqlservercentral.com/articles/Tally+Table/72993/
Thanks for your help Luis - there's plenty to go round in this...
August 19, 2015 at 8:13 am
Here's the first part. Run it, report back with your findings. Are there loads of dupes in the output?
IF OBJECT_ID('tempdb..#DeterminantAttributeValue') IS NOT NULL DROP TABLE #DeterminantAttributeValue
SELECT
DAV.DeterminantAttributeID, DAV.TypeID,
Value1Part =...
August 19, 2015 at 7:35 am
squvi.87 (8/19/2015)
ChrisM@Work (8/19/2015)
1. Spilling sorts occur when the number of rows received by the sort operator is more than the estimate. If you examine the property sheet of the...
August 19, 2015 at 7:24 am
Fantastic, thanks.
1. Spilling sorts occur when the number of rows received by the sort operator is more than the estimate. If you examine the property sheet of the sort operator,...
August 19, 2015 at 7:11 am
Can you post the entire query please, and the definition of the tvf "splitstring".
Cheers.
August 19, 2015 at 6:17 am
;WITH ProcessedData AS (
SELECT EmpName, SwipeDate, MIN_SwipeTime = MIN(SwipeTime), MAX_SwipeTime = MAX(SwipeTime), SwipeType, grp
FROM (
SELECT EmpName, SwipeDate, SwipeTime, SwipeType, grp = rn1-rn2
FROM (
SELECT
EmpName, SwipeDate, SwipeTime, SwipeType,
rn1 = ROW_NUMBER()...
August 19, 2015 at 3:14 am
Viewing 15 posts - 2,236 through 2,250 (of 10,144 total)