Viewing 15 posts - 436 through 450 (of 2,458 total)
I, too, had a real hard time with this, it took me a long time to find where/how to download Dev Edition. I remember that that key was to be...
-- Itzik Ben-Gan 2001
September 28, 2016 at 7:39 pm
Provided you can get away with up to 2 clock_in's and clock_out's per person/date you can do this:
WITH Prep AS
(
SELECT
creation_date = CAST(creation_date...
-- Itzik Ben-Gan 2001
September 28, 2016 at 1:48 pm
This should not be hard, I'm looking at this now.
In the meantime, in case people want easily consumable sample data...
SELECT * INTO dbo.test
FROM
(
VALUES ('168780','10148','16477','7/21/2016 15:00','CLOCK_OUT','1','DAY','RICHAR'),
...
-- Itzik Ben-Gan 2001
September 28, 2016 at 1:23 pm
Eirikur beat me to it on the POC index - that's always the first thing I look for when a window function makes a query much slower.
I would add...
-- Itzik Ben-Gan 2001
September 28, 2016 at 11:58 am
What you are doing does not make much sense. Perhaps you could post some sample data and your desired results and we can point you in the right direction.
a...
-- Itzik Ben-Gan 2001
September 28, 2016 at 11:23 am
Yay. I got one right.
Personally I'd simplify this one like this:
SELECT
DATEADD(YEAR, N, CONVERT(DATE, v.HolidayDate)) AS HolidayDate,
HolidayName
FROM (VALUES ('12/25/2016', 'Christmas Day')) AS v (HolidayDate, HolidayName)
CROSS...
-- Itzik Ben-Gan 2001
September 28, 2016 at 9:43 am
Lynn Pettis (9/27/2016)
mister.magoo (9/27/2016)
Lee Hopkins (9/27/2016)
I wan to use this result to create a declared table
DECLARE @listStr...
-- Itzik Ben-Gan 2001
September 27, 2016 at 6:46 pm
A lot of good advice here, especially
The best way to get better at writing T-SQL is to write a lot of T-SQL.
Over the years I have created dozens of...
-- Itzik Ben-Gan 2001
September 27, 2016 at 6:28 pm
I have no idea what you're trying to do but it seams simple. Please post your desired results. On a side note -
This:
and (cm.Original like'6%' or cm.Original like '7%' or...
-- Itzik Ben-Gan 2001
September 27, 2016 at 6:10 pm
Building off of what Scott said - a table variable is not the best choice for what you are doing because it can't be referenced outside of the dynamic SQL...
-- Itzik Ben-Gan 2001
September 27, 2016 at 10:45 am
For fun, here's another option. This is a function I created a couple months ago which uses NGrams8K[/url]. The function allows you to grab everything between the mth and nth...
-- Itzik Ben-Gan 2001
September 26, 2016 at 12:08 pm
So having 3 schemas in one database? is this the right thing to do or should I have a 3 separate database completely?
It depends.
I have seen this done both...
-- Itzik Ben-Gan 2001
September 22, 2016 at 12:24 pm
erouse (9/21/2016)
Jeff Moden (9/16/2016)
erouse (9/16/2016)
This is my data now.
LABORLC
152685A B C D E
152969A B
This is what...
-- Itzik Ben-Gan 2001
September 21, 2016 at 3:16 pm
What Nicholas proposed will work provided that CN= always comes before OU=. Working with AD, I've see that this is not always the case. If this is how it is...
-- Itzik Ben-Gan 2001
September 20, 2016 at 3:00 pm
dbodell (9/20/2016)
-- Itzik Ben-Gan 2001
September 20, 2016 at 1:03 pm
Viewing 15 posts - 436 through 450 (of 2,458 total)