Forum Replies Created

Viewing 15 posts - 2,986 through 3,000 (of 6,486 total)

  • RE: Convert month to date and add value in datewise from Month column

    You probably want to be careful about DATEPART(weekday), since its return can be affected by the DATEFIRST setting.

    So - consider using:

    SELECT *

    FROM @RESULTS

    where datediff(day,'19000106',[DATE])%7>1

    ORDER BY StudentID, [DATE]

  • RE: QA environment data refresh strategy

    If you're willing to "pay" to not have to rewrite the change scripts - look into Team Suite for Database Developers. By setting up a "database project" - you...

  • RE: QUERY HELP

    The following is what is making the query whine:

    convert(datetime,convert(varchar(2),datepart(mm, [date])) + '/01/' + convert(varchar(4),datepart(yy, [date])))

    You probably need to add [date] or that entire calc to your GROUP BY statement.

  • RE: Choosing the faster option; Stored Procedure or Function?

    I'll save you the pain - that won't work against compat=80....:D

    Actually - neither will. Those are both "compatibility 90" options...

  • RE: Find the Weekend Date

    If you'd rather get away from DATEPART(weekday), (which is affected by the DATEFIRST setting on the server, do a simply math calc from a known Saturday:

    select datediff(day,'19000106',getdate())%7

    Anything with a value...

  • RE: A place for everything

    I'm not sure I follow - you mention 6 physical drives, mapping to 4 logical drives, and yet the policy it to allow only 2?

    If the standard is in fact...

  • RE: SQL Help, find avg of top 3 most recent months fast slow days

    Trent - your big issue is to be able to pick out the top 3 per group. Once you have them - the averages are easy.

    Well - in this...

  • RE: Choosing the faster option; Stored Procedure or Function?

    Todd - assuming that we're dealing with SQL2005, you actually have a few options. One is the "xml trick" - which looks something like this:

    SELECT t1.SomeID,

    ...

  • RE: The row count

    You may be right - I hadn't seen that specific distinction previously (that looks to have been changed from the last time I read it).

    One way or the...

  • RE: The row count

    Kevin Lewis (6/10/2008)


    Wonder if anyone can help me out.

    Whats the difference in execution between the following? Or do they all have the same costs?

    SELECT count(primary_ID) FROM dbo.tblOfMine

    SELECT count(1) FROM dbo.tblOfMine

    SELECT...

  • RE: Deleting more than one row?!

    Jeff beat me to it - but that does sound an awful lot like a foreign key error.

  • RE: Choosing the faster option; Stored Procedure or Function?

    For better or worse - running a function like that will usually end up being very slow. In my experience, functions (T-SQL functions that is) are NOT know for...

  • RE: Aggregating at a higher level?

    Nice one! At the risk of stating the obvious - I wasn't nearly that inspired when I picked mine....:D Good to see someone who was!

  • RE: Aggregating at a higher level?

    Thanks! Been dabbling with the windowed stuff for a little bit - trying to figure them out.

    And - I do like the handle - story teller is always...

  • RE: Aggregating at a higher level?

    Raconteur (6/6/2008)


    Hi Matt,

    Maybe I am doing something wrong, but I am getting the total of all promo_disc_amt for every line in the criteria, including the dupes.

    If I do:

    SELECT DISTINCT order_key,...

Viewing 15 posts - 2,986 through 3,000 (of 6,486 total)