Forum Replies Created

Viewing 15 posts - 3,196 through 3,210 (of 10,144 total)

  • RE: Are the posted questions getting worse?

    Grant Fritchey (7/2/2014)


    Did you hear, for a little while Tim Howard was listed on Wikipedia as the US Secretary of Defense. That's awesome.

    That's brilliant!

  • RE: Are the posted questions getting worse?

    Koen Verbeeck (7/2/2014)


    Jo Pattyn (7/1/2014)


    Funny! :w00t:

    Anyway the Belgium Red Devils got past the USA soccer team after a thrilling match.

    It was an awesome game.

    The US team (actually just the goalkeeper...

  • RE: Grouping by percentage of time worked by person

    Dohsan (7/2/2014)


    ChrisM@Work (7/2/2014)


    Try this:

    SELECT PersonID, StartMonth = MIN(MONTHID), EndMonth = MAX(MONTHID), LOADPCT = PercentLoad

    FROM (

    SELECT *,

    [Grouper] = MONTHID - ROW_NUMBER() OVER(PARTITION BY PersonID, PercentLoad ORDER BY MONTHID)

    ...

  • RE: Grouping by percentage of time worked by person

    Try this:

    SELECT PersonID, StartMonth = MIN(MONTHID), EndMonth = MAX(MONTHID), LOADPCT = PercentLoad

    FROM (

    SELECT *,

    [Grouper] = MONTHID - ROW_NUMBER() OVER(PARTITION BY PersonID, PercentLoad ORDER BY MONTHID)

    FROM #TestProject2...

  • RE: Running total error

    pwalter83 (7/2/2014)


    ChrisM@Work (7/2/2014)


    pwalter83 (7/2/2014)


    ... it does not calculate the ratio for the first row...

    If your calculation depends upon a value from a previous row, what should the result of the...

  • RE: Running total error

    pwalter83 (7/2/2014)


    ... it does not calculate the ratio for the first row...

    If your calculation depends upon a value from a previous row, what should the result of the calculation be...

  • RE: How To Return Zero If No Rows Found

    Your query has four output columns:

    SELECT

    ot.OperationalTypeAlternateKey AS [OperationalTypeAlternateKey]

    ,ot.OperationalType AS [Entry Type]

    ,Convert(Varchar, DateDayOfMonth)+' '+DateMonthName + ' '+ Convert(Varchar,DateYear) AS [Date]

    ,COUNT(*) AS [Total]

    FROM

    If you're returning a single row...

  • RE: Are the posted questions getting worse?

    djj (6/25/2014)


    Just saw a post (on another site) that the person had part of a query list but no quest was asked. Someone posted "What is your question?" and...

  • RE: Running total error

    The issue is a lack of clarity.

    Don't give up. Have a look at the result of this:

    IF OBJECT_ID ('tempdb..#GLT') IS NOT NULL DROP TABLE #GLT

    CREATE TABLE #GLT (

    [Sequence] [int] NULL,

    [WK...

  • RE: Running total error

    pwalter83 (6/25/2014)


    ChrisM@Work (6/25/2014)


    pwalter83 (6/25/2014)


    ChrisM@Work (6/25/2014)


    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    pwalter83 (6/24/2014)


    Jeff Moden (6/24/2014)


    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    Here's a quick rejig of that sample data, and a reformat of the code. Is it only the running...

  • RE: Running total error

    pwalter83 (6/25/2014)


    ChrisM@Work (6/25/2014)


    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    pwalter83 (6/24/2014)


    Jeff Moden (6/24/2014)


    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    Here's a quick rejig of that sample data, and a reformat of the code. Is it only the running total column...

  • RE: Running total error

    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    pwalter83 (6/24/2014)


    Jeff Moden (6/24/2014)


    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    Here's a quick rejig of that sample data, and a reformat of the code. Is it only the running total column which is...

  • RE: Running total error

    pwalter83 (6/24/2014)


    Jeff Moden (6/24/2014)


    pwalter83 (6/24/2014)


    ChrisM@Work (6/24/2014)


    Here's a quick rejig of that sample data, and a reformat of the code. Is it only the running total column which is incorrect?

    IF OBJECT_ID...

  • RE: Help finding a date

    Rog Saber (6/23/2014)


    I'm having trouble writing a query and could use some help please.

    I want to find the earliest time_sched_start_dt, time_sched_end_dt where col_val is null

    and the datediff between time_sched_start_dt and...

  • RE: Help finding a date

    Change

    HAVING DATEDIFF(MINUTE,MAX(CASE WHEN dir = 'S' THEN dt END),MAX(CASE WHEN dir = 'E' THEN dt END)) > @duration

    to

    HAVING DATEDIFF(MINUTE,MAX(CASE WHEN dir = 'S' THEN dt END),MAX(CASE WHEN dir...

Viewing 15 posts - 3,196 through 3,210 (of 10,144 total)