Viewing 15 posts - 3,166 through 3,180 (of 3,479 total)
http://www.manning.com/nielsen/SampleChapter5.pdf
From SQL Server Deep Dives. I think I need to buy this book... <g>
There is also this article...
http://sqlmag.com/sql-server-2012/solving-gaps-and-islands-enhanced-window-functions
using LAG/LEAD. definitely worth a read!
January 20, 2014 at 2:40 pm
I would probably look for an article by Itzik Ben-Gan on it... being that he's a lot smarter than I am.
January 20, 2014 at 2:12 pm
Looks like a running total... if you're using 2012, this works:
sample data setup:
-- create table in tempdb (yes, it probably should have a PK)
CREATE TABLE #pMovement(
pDate DATE,
pallet int,
qty int
);
GO
--...
January 19, 2014 at 8:47 pm
Add a tablix to your layout, then put a rectangle in the cell you want to put these two values in. Then put the two textboxes (for the two...
January 19, 2014 at 6:14 pm
Sounds like a "gaps and islands" question. You're looking for the maximum size of an island.
January 18, 2014 at 8:45 pm
Is the same true if you use a common table expression to calculate the running total?
January 18, 2014 at 5:23 pm
Dwain, I think you get it. The problem was that everything was in Access, and so I ended up writing some really crazy VBA to union the stuff together...
January 15, 2014 at 11:17 pm
Can you just create it as a table-valued function?
CREATE FUNCTION [dbo].[GenerateCalendar]
(
@FromDate DATETIME,...
January 15, 2014 at 10:29 pm
Great! Glad to help.
When in doubt, test it out in TEMPDB.
Either use
USE TEMPDB;
GO
... and then paste your code here
OR prefix the tablename with a # sign....
CREATE TABLE #TableInTempDB...
January 15, 2014 at 9:46 pm
This pretty much explains it -- just run the queries and see what happens:
USE tempdb;
GO
CREATE TABLE SomeDates(TheDate DATE);
INSERT INTO SomeDates VALUES('1/11/2014');
INSERT INTO SomeDates VALUES('1/12/2014');
INSERT INTO SomeDates VALUES('1/13/2014');
INSERT INTO SomeDates VALUES('1/14/2014');
INSERT...
January 15, 2014 at 9:03 pm
Do you mean 'Does it matter the order in which I declare variables and assign them values?' No. Not unless one is dependent upon another.
January 15, 2014 at 8:40 pm
Not sure if this will help if you're querying a DW... this is one way:
SELECT c.CarMake
, c.Country
, c.EventDate
, c.RowNum
FROM
(SELECT CarMake
, Country
, EventDate
, ROW_NUMBER() OVER (PARTITION BY CarMake, Country ORDER...
January 15, 2014 at 7:49 pm
Inside Access, right-click on one of your linked tables, select Linked Table Manager from the menu, and it will show you where the tables are pointing to.
January 15, 2014 at 5:46 pm
Thanks for the help. I think it's closed. I tested it with grade 4, just to short-circuit the record creation, since the "fatal" grade is somewhat arbitrary. ...
January 14, 2014 at 8:59 am
Viewing 15 posts - 3,166 through 3,180 (of 3,479 total)