Forum Replies Created

Viewing 15 posts - 211 through 225 (of 627 total)

  • RE: help with effective dating logic

    is250sp (8/10/2016)


    Alan.B (8/10/2016)


    is250sp (8/10/2016)


    I have a table with the following records.....

    emplid effdt effseqjobcode

    00001068 3/27/200500241

    00001068...

  • RE: help with effective dating logic

    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,...

  • RE: Summarising MONTH value

    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...

  • RE: add getdate() at end of expression

    dallas13 (8/9/2016)


    Hello I m trying to achieve something like this without patindex

    DECLARE @source_path ...

  • RE: Table of Dates in TSQL

    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...

  • RE: Table of Dates in TSQL

    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,

  • RE: fill a years worth of datetimes

    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...

  • RE: Identifying Cloned Databases

    TomThomson (8/4/2016)


    I think the question should have specified SQL Server 2014 SP2 and noted that it applies in no other release.

    There's a connect item asking for the...

  • RE: Today's Random Word!

    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)


    Audience

    Mob

    Mafia

    Made

    Created

    Born

    This way

    Out

    Side

  • RE: Today's Random Word!

    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)


    scratch

    Itch

    Floozy

    woozy

    Sleep

    Wake

    Stir

    Stick

    Ball

  • RE: Are the posted questions getting worse?

    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....

  • RE: Show millisecond value

    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...

  • RE: Today's Random Word!

    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)


    Nap

    Me

    Cute

    Kitten

    Adopt

    Adapt

    Adept

    Proficient

    Efficient

    Inefficient

    Red tape

    Bureaucracy

    Government

    kleptocracy

    Allegation

    Conspiracy

    Theory

    Big Bang

  • RE: Today's Random Word!

    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)


    Nap

    Me

    Cute

    Kitten

    Adopt

    Adapt

    Adept

    Proficient

    Efficient

  • RE: GET MAX VALUE

    ajspencer (7/27/2016)


    Hi Luis, Thanks for responding so quickly. I tried using top 1 however it didn't return the results expected. I've attached a *.png file to show what the data...

Viewing 15 posts - 211 through 225 (of 627 total)