Viewing 15 posts - 3,106 through 3,120 (of 4,087 total)
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....
June 21, 2012 at 7:26 am
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...
June 20, 2012 at 2:50 pm
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...
June 20, 2012 at 12:53 pm
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...
June 20, 2012 at 10:07 am
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...
June 20, 2012 at 9:34 am
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...
June 20, 2012 at 9:09 am
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....
June 20, 2012 at 8:26 am
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...
June 19, 2012 at 8:14 am
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...
June 18, 2012 at 8:23 am
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...
June 14, 2012 at 11:45 am
Ste_P (6/13/2012)
June 14, 2012 at 6:43 am
cfradenburg (6/5/2012)
June 5, 2012 at 12:15 pm
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...
June 5, 2012 at 11:31 am
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....
June 5, 2012 at 9:09 am
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...
June 5, 2012 at 8:53 am
Viewing 15 posts - 3,106 through 3,120 (of 4,087 total)