Forum Replies Created

Viewing 15 posts - 3,106 through 3,120 (of 4,087 total)

  • RE: Unexpected results when I Join, use View or Cross Apply - mysterious

    First, I can't access that link. Second, a picture is not a useful way to post code, because we can't copy and paste it into SSMS to test it....

  • RE: Sum of sums?

    You could probably use the windowing functions with the SUM to get the desired output, but I've found that the windowing functions are not terribly efficient, so you're probably better...

  • RE: INTERSECT 2

    Actually, I don't think that any of the responses are technically correct. While #4 returns similar results to #1, they are not the same. Specifically, #1 returns integers...

  • RE: Comparison Across Columns

    dwain.c (6/20/2012)


    Drew hit the nail on the head. My bug, my bad!

    But I can correct it without the CROSS APPLY!

    You can, but I find the CROSS APPLY simpler and...

  • RE: SQL Query

    It really helps if you give your threads a more descriptive title. The title "SQL Query" applies to every single thread that belongs in this forum. (I can't...

  • RE: Comparison Across Columns

    Yes, the problem is that the width is being used for both Dim1 and Dim2. So the max of the values 4.5, 4.5, 7 is 7 and the max...

  • RE: Pipe delimited row in tsql

    vinu512 (6/19/2012)


    Then what is the use of:

    root('MyString'), type).value('/MyString[1]','varchar(max)'

    You really need to understand how to parse the expression and it really helps to understand the Backus-Naur Form (BNF) descriptions in BOL....

  • RE: Pipe delimited row in tsql

    vinu512 (6/19/2012)


    Can you post a link where there is a good explanation on the STUFF Function, the way it is being used here??

    The BOL entry for STUFF (Transact-SQL) gives a...

  • RE: XML .modify "where" clause problem

    There are several problems with your code.

    First, your "AND" condition isn't correct. You want to modify a node where the same node meets both conditions, but the way that...

  • RE: Using datediff/dateadd function

    Just to clarify, integers can be implicitly converted to date/time data. DATEADD() converts the supplied integer to the required datetime data type.

    The reason that 4 (1900-01-05) is used, is...

  • RE: Problem using COALESCE with GROUP BY

    Ste_P (6/13/2012)


    dogramone: I understand that it's a derived column and that is where the problem lies but SS lets me use this derived column in the Order By statement -...

  • RE: T-SQL data retrival query

    cfradenburg (6/5/2012)


    I agree with Sean here. I can't think of a good reason not to have the columns named what they're supposed to be and not doing that is...

  • RE: Query help

    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 (which...

  • RE: Query using date

    villanueva.jonel (6/5/2012)


    Declare @Fromdatetime datetime, @todatetime datetime

    Set @fromdatetime =dateadd(day,datediff(day,0,'2012/06/04'),'00:00')

    Set @todatetime=dateadd(day,datediff(day,0,'2012/06/05'),'00:00')

    If you only supply a date for a datetime field, the time is defaulted to midnight, so the above is unnecessarily complex....

  • RE: Getting an error Msg 512, Level 16, State 1

    People are hesitant about opening attachments, because it could potentially contain malware. Jeff Moden has great article: Forum Etiquette: How to post data/code on a forum to get the...

Viewing 15 posts - 3,106 through 3,120 (of 4,087 total)