Forum Replies Created

Viewing 15 posts - 76 through 90 (of 104 total)

  • RE: Divide by Zero Error

    Do you think it may have something to do with this line or the one a couple of lines below it (or both)?

    else ((ABS(SUM(isnull(hmss.CREDIT_MEMOS, 0)) + SUM(isnull(hmss.EVEN_EXCHANGE, 0))))/(ABS(SUM(isnull(hmss.CREDIT_MEMOS, 0)) +...

  • RE: Divide by Zero Error

    GSquared (8/5/2009)


    This is probably/possible where the Div 0 error comes from:

    SUM(hmss.BEDDING_CLOSE)/SUM(hmss.BEDDING_OPP)

    If you use NullIf on the Bedding_Opp sum, you should be able to get rid of the error. If...

  • RE: CASE Statement NOT working...

    Lynn Pettis (7/20/2009)


    donato1026 (7/20/2009)


    SELECT

    CASE

    WHEN ITM.MNR_CD = '100' THEN '15' AND

    WHEN ITM.MNR_CD = '105' THEN '10' AND

    WHEN ITM.MNR_CD = '110' THEN '5' AND

    WHEN...

  • RE: CASE Statement NOT working...

    SELECT

    CASE

    WHEN ITM.MNR_CD = '100' THEN '15' AND

    WHEN ITM.MNR_CD = '105' THEN '10' AND

    WHEN ITM.MNR_CD = '110' THEN '5' AND

    WHEN ITM.MNR_CD = '111'...

  • RE: CASE Statement NOT working...

    Lynn Pettis (7/20/2009)


    I think you should look at Lowell's first code block. That looks more like what you want.

    Well, although it is much appreciated, neither of those blocks work....

  • RE: CASE Statement NOT working...

    Lynn Pettis (7/20/2009)


    What are you trying to accomplish with the CASE statement?

    I'm trying to return a desired value as a column... In this case, as SPIFF_BONUS. So, whatever MNR_CD...

  • RE: CASE Statement NOT working...

    donato1026 (7/20/2009)


    This forum has been a tremendous help, which is why I love coming here. Now, I know this is a simple query, but for some reason, my CASE...

  • RE: Query Performance

    OK... could someone just please show me. I'm not very familiar with all of this.

    What kills me is stuff like:

    Msg 102, Level 15, State 1, Procedure AvgCubesByShift, Line 103

    Incorrect...

  • RE: Query Performance

    Sorry guys... At this point, I just want to be able to insert the results into a table.

    If anyone could help me with that, I would greatly appreciate it!

    Thank you...

  • RE: Query Performance

    Chris Morris (4/7/2009)


    My mistake Donato, the top line was eaten:

    DECLARE @Startdate DATETIME, @Enddate DATETIME

    SELECT @Startdate = convert(datetime, '02-APR-09' + ' 03:00:00', 101),

    @Enddate = convert(datetime, '02-APR-09' + ' 20:00:00',...

  • RE: Query Performance

    Chris,

    Could you help me with this?

    I just want this to work now. Inserting the results into a table. Here is my code, however, I get an error:

    set ANSI_NULLS...

  • RE: Query Performance

    Chris Morris (4/7/2009)


    My mistake Donato, the top line was eaten:

    DECLARE @Startdate DATETIME, @Enddate DATETIME

    SELECT @Startdate = convert(datetime, '02-APR-09' + ' 03:00:00', 101),

    @Enddate = convert(datetime, '02-APR-09' + ' 20:00:00',...

  • RE: Query Performance

    Chris Morris (4/7/2009)


    Can you run this please, with and without the derived table which is currently commented out, and post back the run times:SELECT @Startdate = convert(datetime, '02-APR-09' +...

  • RE: Query Performance

    For the time being, I would love to be able to take the results from this query, and create a STORED PROCEDURE that INSERTS the results into a table:

    SELECT itl.user_id,...

  • RE: Query Performance

    Actually, for right now, I am happy with just being able to INSERT the results into a table for now.

    Here is my code that I have right now, but it's...

Viewing 15 posts - 76 through 90 (of 104 total)