Viewing 15 posts - 1,171 through 1,185 (of 1,244 total)
Take a look at the attached RDL file... It's a very simple layout so it should be a simple matter to "reverse engineer" it to see how it was constructed.
HTH,
Jason
May 26, 2015 at 10:07 pm
I think a slightly more simplistic sample offers a better illustration of what happens with LAG & LEAD in relation to the order by clause...
-- Test Data --
IF OBJECT_ID('tempdb..#temp') IS...
May 26, 2015 at 8:43 am
alex.sqldba (5/25/2015)
Am I correct in thinking that the Window Frame portion is the part of the call that uses 'unbounded preceding' ~ 'current row'? Or is there more to it?
Cheers
You...
May 25, 2015 at 7:47 pm
If you're getting into windowed functions in SQL 2012, I'd encourage to to also included "Window Frames" in your study.
Windowed functions are an extremely powerful feature, and 2012's inclusion of...
May 25, 2015 at 3:28 pm
The following should get you what you're looking for...
SELECT
al1.RCDID,
al1.EMPLOYEEID,
al1.LOGDATE,
LEFT(al1.LOGTIME, 5) AS [IN],
LEFT(al3.LOGTIME, 5) AS [OUT]
FROM
dbo.AccessLog al1
CROSS APPLY (
SELECT TOP 1
al2.LOGTIME
FROM
dbo.AccessLog al2
WHERE
al1.RCDID = al2.RCDID
AND al1.EmployeeID = al2.EmployeeID
AND al1.LOGDATE =...
May 24, 2015 at 11:25 am
This should give you the results you're looking for...
/* ==================================================
Test Data
================================================= */
IF OBJECT_ID('tempdb..#FY1') IS NOT NULL
DROP TABLE #FY1;
CREATE TABLE #FY1 (
CustomerNo CHAR(4),
OrderAvg INT,
OrderCount INT
);
INSERT #FY1 (CustomerNo,OrderAvg,OrderCount) VALUES
('0155', 300,...
May 23, 2015 at 3:29 pm
Jeff Moden (5/22/2015)
The only reason to use a tablix filter is if you you have multiple tablix objects that are displaying subsets of a single,...
May 22, 2015 at 10:22 pm
Jeff Moden (5/22/2015)
Jason A. Long (5/22/2015)
Lowell (5/19/2015)
May 22, 2015 at 8:13 pm
FranciscoLUIPires (5/20/2015)
In a nutshell, what I need to do is run reports that are on a 2008 R2 on a 2012 SP2.
Why? Because I need them to run...
May 22, 2015 at 7:16 pm
Lowell (5/19/2015)
i inherited a suite of...
May 22, 2015 at 7:06 pm
Oh... Just a side note... If/when you make the jump to SQL Server 2012 or later, revisit this code. You'll be able to use the LAD & LEAD functions to...
May 22, 2015 at 12:51 pm
jkalmar 43328 (5/22/2015)
May 22, 2015 at 12:47 pm
SQLRNNR (5/22/2015)
Jason A. Long (5/22/2015)
Grant Fritchey (5/22/2015)
I understand that some cultures look at it very differently than most Western...
May 22, 2015 at 11:49 am
Using just the base test data (w/o the updates)
; WITH CTE AS (
SELECT
t.KitID,
t.SubjID,
t.VISIT,
t.VISITNUM,
t.LBDTC,
ROW_NUMBER() OVER (ORDER BY t.SubjID,t.LBDTC,t.KitID) AS rn1,
ROW_NUMBER() OVER (PARTITION BY t.VISITNUM ORDER BY t.SubjID,t.LBDTC,t.KitID) AS rn2
FROM
#testing...
May 22, 2015 at 11:31 am
Grant Fritchey (5/22/2015)
I understand that some cultures look at it very differently than most Western European-based ones do. There's...
May 22, 2015 at 10:29 am
Viewing 15 posts - 1,171 through 1,185 (of 1,244 total)