Forum Replies Created

Viewing 15 posts - 1,366 through 1,380 (of 2,007 total)

  • RE: ISERROR

    carl.meads (11/14/2011)


    I have the following

    SELECT #callhandling2.client

    ,#callhandling2.daycat+' '+#callhandling2.timecat as [Category]

    ,Sum(#callhandling2.calls) as [Total Calls]

    ,[Calls Per 30 Mins] = Case

    When #callhandling2.daycat+' '+#callhandling2.timecat='Weekend 20:00-08:00' then if(iserror(Sum(#callhandling2.calls)/2208.0)),0,Sum(#callhandling2.calls)/2208.0

    When #callhandling2.daycat+' '+#callhandling2.timecat='Weekend 08:00-20:00' then Sum(#callhandling2.calls)/2208.0

    When #callhandling2.daycat+' '+#callhandling2.timecat='Weekday...

  • RE: Dates. Similar statement in where failing.

    Hello and welcome to SSC!

    The main reason that you are not getting any replies for your question, it that we don't have enough information from you to answer!

    For starters, it...

  • RE: Finding previous Saturday

    You're right drew, didn't think about that. This works though: -

    SELECT DATEADD(DAY, DATEDIFF(DAY, 6, @calenderDate) /7 * 7, 5)

  • RE: How to check only the numeric values at the same time ignoring the symbols or characters using SQL queries

    mvijaykumar.mca (11/11/2011)


    I have a table with a field with values given below. the ID field is a varchar type

    ID

    ---

    2|4|6

    These 2,4 and 6 are actually a primary key values of a...

  • RE: First sunday prefious month - 6 days

    jbrewer (11/11/2011)


    I am working with 2 payrolls that end on Saturday and Sundays. I need to report the hours for the first weekending date of the previous month. ...

  • RE: Finding previous Saturday

    Try this: -

    SELECT DATEADD(DAY, DATEDIFF(DAY, 5, @calenderDate) /7 * 7, 5)

    DECLARE @calenderDate SMALLDATETIME

    SET @calenderDate = '2011-11-04'

    SELECT DATEADD(DAY, DATEDIFF(DAY, 5, @calenderDate) /7 * 7, 5)

    SET @calenderDate = '2011-11-05'

    SELECT DATEADD(DAY, DATEDIFF(DAY, 5,...

  • RE: First sunday prefious month - 6 days

    Is this what you're after?

    SELECT DATEADD(D, -6, DATEADD(D, DATEDIFF(D, 6, DATEADD(M, 12 * DATEPART(YY, GETDATE()) + DATEPART(M, DATEADD(M, -1, GETDATE())) - 22801, 6)) / 7 * 7, 6)) AS firstSunday_minus_6,

    DATEADD(D,...

  • RE: Second Pair of Eyes, Please

    You're missing brackets Brandie: -

    EXECUTE (@sqlstmt);

  • RE: Complex update query

    sc-w (11/10/2011)


    IDGroup A|Group B| Group C

    1:True| False | True

    2:False | False ...

  • RE: Cannot resolve the collation conflict...

    What happens if you add COLLATE ?

    BEGIN TRANSACTION

    DECLARE @MyId CHAR(11)

    DECLARE @MyEmail VARCHAR(255)

    DECLARE @MyFirstname VARCHAR(255)

    DECLARE @MySubject VARCHAR(MAX)

    DECLARE @MyBody VARCHAR(MAX)

    DECLARE @stime DATETIME

    DECLARE @etime DATETIME

    DECLARE @ftime INT

    DECLARE @passeddays INT

    DECLARE @temp INT

    SELECT @stime =...

  • RE: I desperately need query optimization: query already runs for 1.5 days.

    Seriously? Have you seen how many times you hit the "prospects" table every time your god-awful cursor runs?

    If I feel particularly masochistic this weekend, I might have a look. To...

  • RE: GROUPING CASE

    *sigh*

    OK, here is my guess at your requirements. If I'm incorrect, read this article (http://www.sqlservercentral.com/articles/Best+Practices/61537/)[/url] then post DDL and readily consumable sample data.

    First, here is the sample data I've used.

    IF...

  • RE: GROUPING CASE

    matt_scott1984 (11/10/2011)


    Hello all,

    I have the following code:

    SELECT TOP (100) PERCENT tr_trrefn, tr_abbrv,

    ...

  • RE: awfwf

    matt_scott1984 (11/10/2011)


    Hello all,

    I'm very inexperei

    SELECT TOP (100) PERCENT tr_trrefn, tr_abbrv,

    ...

  • RE: how to specify an exact amount of rows to display in a table?

    anthony 80098 (11/10/2011)


    Hi all,

    I've managed to figure this one out by simply adding 15 footer records to my group and then hiding these when i have records to display. This...

Viewing 15 posts - 1,366 through 1,380 (of 2,007 total)