Viewing 15 posts - 211 through 225 (of 627 total)
is250sp (8/10/2016)
Alan.B (8/10/2016)
is250sp (8/10/2016)
emplid effdt effseqjobcode
00001068 3/27/200500241
00001068...
August 10, 2016 at 1:39 pm
Does this work for you?
DECLARE @myTable TABLE (empID INT, effdt DATETIME, effseq BIT, jobcode INT)
INSERT INTO @myTable
VALUES (00001068, '20050327', 0, 0241), (00001068, '20050327', 1, 0244), (00001070, '20050327', 0, 0241), (00001070,...
August 10, 2016 at 1:00 pm
For your second requirement you can achieve that using a window function. If you want an example please provide DDL and sample data. Luis' signature has links on...
August 10, 2016 at 7:22 am
dallas13 (8/9/2016)
DECLARE @source_path ...
August 9, 2016 at 2:30 pm
Here is technically a two line solution (which can be only 1 if you don't use variables)... 😉
DECLARE @startDate DATE = '20160101', @skipWeeks TINYINT = 4, @maxWeeks TINYINT = 54
SELECT...
August 9, 2016 at 8:50 am
David Burrows (8/9/2016)
SELECT DATEADD(week,Weeks,@StartDate) AS [MonthEnd]
FROM (VALUES (0),(4),(8),(12),(16),(20),(24),(28),(32),(36),(40),(44),(48),(32)) w (Weeks)
Hi David,
I think you have a typo in your values...shouldn't that 32 at the end be a 52?
Cheers,
August 9, 2016 at 7:16 am
Here's my stab at it...
DECLARE @startdate DATETIME = '20160101'
DECLARE @enddate DATETIME = '20161231'
;WITH Tally (n) AS
(
SELECT TOP (SELECT DATEDIFF(mi, @startdate, @enddate)) ROW_NUMBER() OVER (ORDER BY (SELECT...
August 4, 2016 at 10:01 am
TomThomson (8/4/2016)
There's a connect item asking for the...
August 4, 2016 at 7:35 am
Luis Cazares (8/3/2016)
Hugo Kornelis (8/3/2016)
Ed Wagner (8/3/2016)
crookj (8/3/2016)
djj (8/3/2016)
Grumpy DBA (8/3/2016)
djj (8/3/2016)
Ed Wagner (8/2/2016)
AudienceMob
Mafia
Made
Created
Born
This way
Out
Side
August 3, 2016 at 7:08 am
Revenant (8/2/2016)
crookj (8/2/2016)
Ray K (8/2/2016)
Ed Wagner (8/2/2016)
whereisSQL? (8/2/2016)
Grumpy DBA (8/2/2016)
Ed Wagner (8/2/2016)
jasona.work (8/1/2016)
scratchItch
Floozy
woozy
Sleep
Wake
Stir
Stick
Ball
August 2, 2016 at 9:25 am
My MongoDB training starts today...there goes the neighborhood! :crazy:
Always a good thing to learn new skills but at my age I seem to forget more things than I take in....
August 2, 2016 at 9:21 am
Just a stab here but does this work?
select
CONVERT(TIME, DATEADD(ms, DATEDIFF(ms, last_request_start_time, GETDATE()), 0), 114) AS Duration,
*
from sys.dm_exec_sessions
where (status <> 'sleeping' or open_transaction_count > 0)
order by last_request_end_time...
August 2, 2016 at 7:46 am
Hugo Kornelis (7/28/2016)
Revenant (7/28/2016)
whereisSQL? (7/28/2016)
TomThomson (7/28/2016)
djj (7/27/2016)
whereisSQL? (7/27/2016)
Hugo Kornelis (7/27/2016)
djj (7/27/2016)
Y.B. (7/27/2016)
crookj (7/27/2016)
djj (7/27/2016)
Stuart Davies (7/27/2016)
whereisSQL? (7/26/2016)
djj (7/26/2016)
Revenant (7/26/2016)
Grumpy DBA (7/26/2016)
whereisSQL? (7/26/2016)
NapMe
Cute
Kitten
Adopt
Adapt
Adept
Proficient
Efficient
Inefficient
Red tape
Bureaucracy
Government
kleptocracy
Allegation
Conspiracy
Theory
Big Bang
July 28, 2016 at 11:26 am
crookj (7/27/2016)
djj (7/27/2016)
Stuart Davies (7/27/2016)
whereisSQL? (7/26/2016)
djj (7/26/2016)
Revenant (7/26/2016)
Grumpy DBA (7/26/2016)
whereisSQL? (7/26/2016)
NapMe
Cute
Kitten
Adopt
Adapt
Adept
Proficient
Efficient
July 27, 2016 at 8:14 am
ajspencer (7/27/2016)
July 27, 2016 at 8:09 am
Viewing 15 posts - 211 through 225 (of 627 total)