Forum Replies Created

Viewing 15 posts - 11,521 through 11,535 (of 26,486 total)

  • RE: Query help

    drew.allen (6/5/2012)


    That doesn't work Lynn, because the OrderDate is not in the GROUP BY, so it cannot be used in the ORDER BY clause unless it's in an aggregate function...

  • RE: Improve performace of a simple query

    Sean Lange (6/5/2012)


    WOW your datatypes are a disaster. I don't mean to sound insulting but these tables have so many problems it is hard to comment on all of them.

    --------------------------

    Table...

  • RE: switching from txt box to calendar

    Other than changing this:

    and DATEPART(YEAR, e.eecDateOfLastHire) = @yearpicked

    to this:

    and e.eecDateOfLastHire >= dateadd(yy, (@yearpicked - 1900), 0) and e.eecDateOfLastHire < dateadd(yy, (@yearpicked - 1900) + 1, 0)

    Your code doesn't necessarily need...

  • RE: Tricky SQL - Please Help

    David Moutray (6/5/2012)


    Fair enough. You should do the work. I should do the work. However, we should not make others do the work. Define your acronyms...

  • RE: Tricky SQL - Please Help

    David Moutray (6/5/2012)


    An acronym is always unknown to someone. Think of the new guy who might never have heard or seen it before.

    Also, Google is fallible. There are...

  • RE: Tricky SQL - Please Help

    David Moutray (6/5/2012)


    Oh, and you want to do that fifteen times per page while you're reading? What about corporate acronyms that don't exist on Google?

    I know, I must have...

  • RE: Managing Risk

    First, my favorite President is Theodore Roosevelt. After reading this little bit about President Lincoln though, I realize that if I were elected President (never happen) that I would...

  • RE: Query help

    Try this:

    select

    year(OrderDate) AS OrderYear,

    MonthForTheYear = CASE WHEN MONTH(OrderDate)=1 THEN 'January'

    ...

  • RE: Tricky SQL - Please Help

    David Moutray (6/5/2012)


    YMMV on that one

    Oh, and I absolutely despise abbreviations! What, are you too lazy to type it out?

    What the *&(^% does YMMV stand for?

    (See what...

  • RE: Store Procedure is not getting executed via application but executes in SSMS

    When you run the stored procedure in SSMS do you run it as the same user that attempts to run it from the application?

  • RE: can we get this guy banned from the forums?????

    LightVader (6/5/2012)


    Michael Valentine Jones (5/24/2012)


    Brevity and obscurity

    declare @ char(3)

    set @=0

    while @<100

    begin

    set @=@+1

    print

    case when @%15=0 then 'FizzBuzz'

    when @%3=0 then 'Fizz'

    when @%5=0 then 'Buzz'

    else @ end

    end

    I didn't realize that you didn't need...

  • RE: Choosing by year

    krypto69 (6/4/2012)


    thanks Geoff! exactly what I needed!

    Just remember that this, and DATEPART(YEAR, e.eecDateOfLastHire) = @yearpicked, won't make use of an index on e.eecDateOfLastHire if it exists.

  • RE: Improve performace of a simple query

    And the DDL for the tables and the execution plan.

  • RE: TimeZone Function Causing Blcking

    Lynn Pettis (6/4/2012)


    r.pe (6/4/2012)


    Does not seem to be. I have included the def in the attachement.

    Thanks.

    Even that function has a function call, dbo.fn_NTDayOfWeek.

    Okay, missed this one: dbo.fn_FirstDayOfMonth.

  • RE: TimeZone Function Causing Blcking

    r.pe (6/4/2012)


    Does not seem to be. I have included the def in the attachement.

    Thanks.

    Even that function has a function call, dbo.fn_NTDayOfWeek.

Viewing 15 posts - 11,521 through 11,535 (of 26,486 total)