Forum Replies Created

Viewing 15 posts - 4,321 through 4,335 (of 6,397 total)

  • RE: sp_who2 shows blank loginame

    Parellel queries is at the DB end and will be down to the execution plans and the way the SQL optimizer thinks is the best way to get the data...

  • RE: SQL Server Query

    Jan to Jan inclusive, so Jan 2011 to Dec 2011 plus Jan 2012 or just Jan 2011 to Dec 2011

    For Jan to Dec use

    SELECT * FROM AllData

    WHERE

    YearEnd = 2011

    AND

    DIV =...

  • RE: Help with Query - group by error

    If you run your original query, against the new query and export the actual query plans, I would be interested to see the differences, especially around the SARGable parts with...

  • RE: SQL Server Query

    Its your month end where clauses

    What you have is >= 1 and a <=1 which results in = 1

    If you remove the month_end where clauses it should work as you...

  • RE: Rogue transaction log backup

    Yes typically you would have an agent installed running as a service.

    Have you checked through the definitions of any procedures which may be executing a backup log command and a...

  • RE: Help with Query - group by error

    doh, got to add a name for the derived table,

    just add AS derived1 to the last line after the )

  • RE: Help with Query - group by error

    Give the below a try.

    SELECT

    CAST(AverageFixTime/60 AS VARCHAR(10)) + ':' + RIGHT('00' + CAST(AverageFixTime%60 AS VARCHAR(10)), 2),

    SupportGroup,

    [Month]

    FROM

    (

    SELECT

    (AVG(fix_time)/60) AS AverageFixTime,

    SuppGroup AS SupportGroup,

    DATENAME(MONTH,date_time) AS [Month]

    FROM

    calltable

    WHERE

    suppgroup IN ('WEBS', 'Tech','SQL')

    AND

    status <>'17'

    AND

    date_time...

  • RE: Rogue transaction log backup

    Something like NetBackup or another 3rd party component coming in doing the backup?

  • RE: The Beer Cooler Thread

    Can you ship some to the UK for us please? Reading them reviews after a quick Google, sounds right up my street.

  • RE: Help with Query - group by error

    exactly the same way as before, just replace the above for your original inner query

  • RE: Complex query

    Sounds a bit like a running total query

    http://www.sqlservercentral.com/articles/T-SQL/68467/

  • RE: Help with Query - group by error

    Something like this

    SELECT

    AVG(fix_time) AS AverageFixTime,

    SuppGroup AS SupportGroup,

    DATENAME(MONTH,date_time) AS [Month]

    FROM

    calltable

    WHERE

    suppgroup IN ('WEBS', 'Tech','SQL')

    AND

    status <>'17'

    AND

    date_time >= '2012-04-01'

    AND

    date_time < '2012-07-01'

    GROUP BY

    suppgroup,

    DATENAME(MONTH,date_time)

  • RE: Help with Query - group by error

    Can you attach the query plan for your original query and this one

    Looking at the query and what Andy has already said, the second group by isnt required as the...

  • RE: Divide by zero error encountered.

    You would need to build a check in that anything which is 0 is set to 1 when doing the divide.

    Something like

    CASE WHEN col = 0 THEN 1 ELSE...

  • RE: Find Averages ignoring high/low values

    Phil

    What should the output based on the current test data look like

    EG

    ManufacturingOrderIdSomeColumnProductIdProcessNameQuantity

    MO01508111-FAU440AASSEMBLY60.00000

    MO01508121-FAU440AASSEMBLY75.00000

    MO01508111-FAU440AASSEMBLY255.00000

    MO01508111-FAU440AASSEMBLY330.00000

    MO01508111-FAU440AINSPECTION30.00000

    MO01508111-FAU440ATEST60.00000

    MO02114311-FAU440AASSEMBLY30.00000

    MO02114321-FAU440AASSEMBLY45.00000

    MO02114311-FAU440AASSEMBLY105.00000

    MO02114311-FAU440AASSEMBLY360.00000

    MO02114311-FAU440AASSEMBLY495.00000

    MO02114311-FAU440AINSPECTION45.00000

    MO02114311-FAU440AINSPECTION105.00000

    MO02114311-FAU440ASTORES/DISPATCH240.00000

    MO02114321-FAU440ATEST60.00000

    MO02114311-FAU440ATEST195.00000

    MO02114311-FAU440ATEST300.00000

    MO02261621-FAU440AASSEMBLY30.00000

    MO02261611-FAU440AASSEMBLY60.00000

    MO02261611-FAU440AASSEMBLY240.00000

    MO02261611-FAU440AASSEMBLY360.00000

    MO02261611-FAU440AASSEMBLY495.00000

    MO02261611-FAU440ASTORES/DISPATCH360.00000

    MO02261611-FAU440ATEST30.00000

    MO02261611-FAU440ATEST435.00000

    MO02429711-FAU440AASSEMBLY120.00000

    MO02429711-FAU440AASSEMBLY255.00000

    MO02429711-FAU440AASSEMBLY405.00000

    MO02429711-FAU440AINSPECTION45.00000

    MO02429711-FAU440ASTORES/DISPATCH330.00000

    MO02429711-FAU440ATEST15.00000

    MO02429721-FAU440ATEST30.00000

    MO02429721-FAU440ATEST180.00000

    MO02429711-FAU440ATEST255.00000

    MO02429711-FAU440ATEST270.00000

    MO02483911-FAU440BINSPECTION15.00000

    MO02483911-FAU440BTEST180.00000

    MO02483911-FAU440BTEST195.00000

    MO02484611-FAU440BASSEMBLY90.00000

    MO02484611-FAU440BINSPECTION15.00000

    MO02484611-FAU440BTEST120.00000

    MO02484611-FAU440BTEST180.00000

    MO02507011-FAU440BASSEMBLY15.00000

    MO02507011-FAU440BASSEMBLY60.00000

    MO02507011-FAU440BINSPECTION30.00000

    MO02507011-FAU440BTEST30.00000

    MO02507011-FAU440BTEST120.00000

    MO02507011-FAU440BTEST240.00000

    MO02520621-FAU440BASSEMBLY30.00000

    MO02520611-FAU440BINSPECTION15.00000

    MO02520611-FAU440BTEST45.00000

    MO02520611-FAU440BTEST60.00000

    MO02520611-FAU440BTEST105.00000

    MO02520611-FAU440BTEST120.00000

    MO02520611-FAU440BTEST240.00000

    MO02520611-FAU440BTEST270.00000

    MO02520611-FAU440BTEST375.00000

Viewing 15 posts - 4,321 through 4,335 (of 6,397 total)