Forum Replies Created

Viewing 15 posts - 7,921 through 7,935 (of 10,144 total)

  • RE: Subquery returns more than 1 value

    CREATE PROCEDURE USP_UPDATESAL

    @DPID INT

    AS

    UPDATE Humans

    SET SAL = CASE deptid

    WHEN 10 THEN 40000

    WHEN 20 THEN 38000

    WHEN 30 THEN 10000

    WHEN 40 THEN 0

    WHEN 50 THEN -1

    END

    WHERE deptid...

  • RE: Today's Random Word!

    Continuously-variable transmission

  • RE: Are the posted questions getting worse?

    There's a rumour circulating about a pole-dancing chipmunk

  • RE: Today's Random Word!

    mbricker-600840 (5/13/2010)


    tosscrosby (5/13/2010)


    tyromancy

    I wonder how that works?

    My wife is quite the lover of cheese. I wonder if that was involved in her choice of me as a mate.

    We...

  • RE: calculate dates between rows

    There might be some mileage in this too:

    SET DATEFORMAT DMY

    DROP TABLE #Temp

    CREATE TABLE #Temp (Art CHAR(1), [Status] VARCHAR(3), [Date] DATE)

    INSERT INTO #Temp (Art, [Status], [Date])

    SELECT 'A', 'In', '10/10/2009' UNION...

  • RE: Divide by zero error when using CASE statement

    turkey-500673 (5/10/2010)


    Thanks for the great solutions, but none of them worked. I'm going to take the numerator and make 1 field and the divisor another field in a temp table,...

  • RE: PIVOT UNPIVOT IN SQL2005

    mukherjee.subhro (5/10/2010)


    ...the orderyear field the O/P is coming like cnt2007,cnt2008.... like that;

    I want to omit this cnt portion, if you have any suggestion then please sent me by tomorrow.

    I think...

  • RE: PIVOT UNPIVOT IN SQL2005

    mukherjee.subhro (5/10/2010)


    Yea !

    I mean what you have understood i.e. stripping the first 3 alphabet and taking only the numeric portion (i.e. year) . The output is in...

  • RE: Today's Random Word!

    Grimouse

  • RE: PIVOT UNPIVOT IN SQL2005

    mukherjee.subhro (5/10/2010)


    Hello Sir

    Please look at the image file that I have send with this reply,I have run as per your suggestion removing the typecast and it...

  • RE: PIVOT UNPIVOT IN SQL2005

    Try it without the CAST, change

    SELECT empid,CAST(orderyear AS INT)AS orderyear,numorders

    to

    SELECT empid, orderyear, numorders

  • RE: Today's Random Word!

    Tom.Thomson (5/10/2010)


    RBarryYoung (5/9/2010)


    tosscrosby (5/6/2010)


    I apologize for my morbid-ness, but you have to admit that you probably learned a new word (I sure did!).

    For something totally different:

    Callipygian

    (how Jeff talks...

  • RE: Divide by zero error when using CASE statement

    The simplest way is to avoid the calculation altogether;

    c_new_PP = CASE WHEN oe_line.unit_price = 0 OR inventory_supplier.cost = 0 THEN 0 ELSE

    (

    (

    (100 * inventory_supplier.cost * 1.1)

    / (

    100.00000001 - (oe_line.unit_price...

  • RE: CTE and Self Join with NULL Values

    There may be some mileage in this:

    ;WITH EnrollmentRollup AS (

    SELECT

    StudentID,

    Summary = SUM(CASE ActionClass WHEN 'E' THEN 1 WHEN 'W' THEN -1 ELSE 0 END),

    Actions = COUNT(*)

    FROM #Enrollment

    WHERE...

  • RE: Today's Random Word!

    Paul White NZ (5/7/2010)


    Tom Brown (5/7/2010)


    It's the first time I've ever had to queue to vote.

    I'm quite surprised no-one has challenged some of the very close results yet because...

Viewing 15 posts - 7,921 through 7,935 (of 10,144 total)