Forum Replies Created

Viewing 15 posts - 58,291 through 58,305 (of 59,048 total)

  • RE: Calculating void calls

    In that case... this works... there may be a correlated sub-query solution but I didn't use one... obviously, you would replace #yourtable with your real table name after you're done...

  • RE: Suming DateDiff

    Shane,

    Do you want only the downtime between 10:00 and 11:00 or do you want the downtime for every hour of a given day?  Also, is there a date associated with...

  • RE: find the first and last date of the week

    What day of the week do you consider the first day of the week to be?

  • RE: Calculating void calls

    What is it that distiguishes CaseID 2 from 1 and 3?  As in your first example of data, what connects ANY 2 calls (CaseID's) if multiple calls meet the same conditions?

  • RE: How to Show Columns as Rows

    Guess I read it differently, Marshall... I didn't read the original request as a full transposition based on what some folks have asked for in the past...  Not enough coffee

  • RE: Full date given week date part and year

    Just a follow up... I did some million row testing on the simple functions we created here...

    On a quiet multiprocessor box, the functions returned about 12% faster than the inline...

  • RE: Want to Display All Values Of IN Statement.

    Untested but should work...

     SELECT d.Value AS [IN Statement],
            CASE 
                WHEN ta.Col_1 IS NULL
                THEN 'No Match'
                ELSE ta.Col_1
            END AS [Values Col_A Matches]
       FROM TabA ta
      RIGHT OUTER JOIN
            (--Derived...
  • RE: Splitting rows into columns

    Unless your data actually looks more like the following, the code is going to be a wee bit more complicated than what I have below...

    TxnNo    Amount   Type

    100        1500       R

    100       ...

  • RE: Full date given week date part and year

    You shouldn't necessarily need a function to convert a VARCHAR date to a datetime to save in a table... it's one of those "instrinsic conversions" that happen auto-magically if the...

  • RE: How to Show Columns as Rows

    KH did it right... if you expand upon the example KH provided, it works great, is nasty fast, and does not require a trip to the app.

  • RE: compute results

    Zia,

    Instead of using COMPUTE, consider using WITH ROLLUP or WITH CUBE.  There's some great documentation on how to exploit the related GROUPING sub-totals for ROLLUP and CUBE in Books OnLine under...

  • RE: Full date given week date part and year

    Dave,

    Very volitile subject... I got involved with a pretty big discussion on this subject before and I'll just say that, in all the "million-row" testing I did, I satisfied myself that properly...

  • RE: speed up LEN(RTRIM(LTRIM(ERR))) > 0????

    They say that one test is worth a thousand calculations and a million guesses... Noeld is correct.  But don't take my word for it... I expanded my normally well behaved...

  • RE: Full date given week date part and year

    Very nice... very nice indeed...

    These might execute a bit quicker... in fact, considering that they're single line formulas, you may not want to use them as functions, at all.. just...

  • RE: Help me with this t-sql

    For the data presented, this'll do it... and it doesn't assume that there will only be different 3 rows in the return...

    SELECT Col1,Col2,Col3,MAX(Col4) AS Col4
    FROM yourtable
    GROUP BY Col1, Col2, Col3
    ORDER...

Viewing 15 posts - 58,291 through 58,305 (of 59,048 total)