Forum Replies Created

Viewing 15 posts - 3,406 through 3,420 (of 10,144 total)

  • RE: Need Assistance for Groups and Islands Problem

    vignesh.ms (4/30/2014)


    ...

    But My real time table have 13 digit nos. It through Arithmetic overflow error

    Please provide some realistic sample data so that folks attempting to help won't have the same...

  • RE: SQL Query

    Assuming you are referring to the ORDER BY clause, then visualising the result of those CASEs will help:

    DROP TABLE #OFFICES

    CREATE TABLE #OFFICES (

    OFFICEID INT NOT NULL,

    OFFICENAME VARCHAR(100),

    HEADOFFICEID INT

    )

    INSERT INTO #OFFICES...

  • RE: SQL Help requested to Get Daily and Weekly OT

    On second thoughts, Thava's query appears to do the trick - the boundary between daily OT and weekly OT isn't total hours, it's regular hours. My query becomes this:

    -- Daily_OT...

  • RE: SQL Help requested to Get Daily and Weekly OT

    '01/06/2014', '14.25', 'Monday'-- REG = 8.00, DAILY_OT = 6.25, WEEKLY_OT = 0.00, TOTAL HOURS = 14.25

    '01/07/2014', '12.25', 'Tuesday'-- REG = 8.00, DAILY_OT = 4.25, WEEKLY_OT = 0.00, TOTAL HOURS =...

  • RE: Performance related question

    -- SPI CPI - Programscores

    SELECT

    a.ProgramId, a.Tier4Id, a.[DATE],

    SPI= a.Value7,

    SPI_H= CASE

    WHEN a.[Value7] IS NULL OR ISNULL(m7.[IsGoalOriented],0) = 0 THEN 5 /*OR MBM.fn_CheckGoalsAvailability(A.MetricId) = 0 */

    WHEN a.[Value7] BETWEEN...

  • RE: Performance related question

    “Peel one potato at a time” as Jeff says. Firstly, separate out the source query from the MERGE statement. What you notice with this simplification - cutting down only...

  • RE: Joining where values do not equal one another

    jhinch (4/23/2014)


    I apologize for not using the proper forum etiquette. This was my first post ever, and I overlooked the etiquette section before posting. I will follow the...

  • RE: Using CASE Statements

    mlwiller2 (4/24/2014)


    Yeah CASE was the wrong term to use. Looks like I want something like this:

    IF ((SELECT DATEPART(MONTH, GetDate())) = 04)

    UPDATE

    db1

    SET

    ...

  • RE: Performance related question

    And while you're doing that, don't forget the effect of wrapping functions around columns in your WHERE clause (or joins)

    WHERE S.LSKINdicator = 1

    AND S.ProjectId IS NOT NULL

    /*AP3-820 Check for...

  • RE: Using CASE Statements

    mlwiller2 (4/24/2014)


    I'm having some trouble grasping the use of CASE statements (used to using If/Then). I would like to convert this to CASE format:

    If DATEPART(Month,Datetime) = 04

    ...

  • RE: Inserting multiple records from a single variable

    Your sample indicates that table1 is an exact copy of two columns of table2 - is this really the case?

    Here's one way to do what you want, if table1 is...

  • RE: Query optimization help

    Lynn Pettis (4/23/2014)


    I have downloaded and looked at both of the latest sqlplans, both use the same index due to the use of the WITH(INDEX(AI_OperatorCBGEstimate_HAP)) index hint on the query.

    File...

  • RE: Drop Identity column from temp table

    The two CROSS APPLY blocks collect the column lists. FOR XML PATH concatenates the lists into a string. You can read about APPLY in the two excellent articles by Paul...

  • RE: Query optimization help

    Why did you create two identical indexes?

    How many environments do you have which will run this query?

  • RE: Drop Identity column from temp table

    Can you present the user with a list of relevant tables? If not, you could check the passed-in tablename against a list.

Viewing 15 posts - 3,406 through 3,420 (of 10,144 total)