Viewing 15 posts - 3,931 through 3,945 (of 4,087 total)
You can also filter in your XPath expression. For example:
SELECT
b.header.value('Value[1]', 'varchar(20)') AS Typex2
FROM @bb.nodes('//ProcessTraceNode[contains(FunctionSymbol[1],"SUBFORMULA")]') AS b(header)
I'm not sure which is more efficient.
Drew
August 11, 2010 at 9:33 am
If you group on the driver ID, you can find the Min() of the status. You can also use a PIVOT if the group by won't work for some...
August 11, 2010 at 8:33 am
ColdCoffee (8/10/2010)
INNER JOIN will fail with the following sample data :
A CROSS JOIN with a WHERE clause that references both tables is essentially the same as an INNER JOIN.
Please correct...
August 10, 2010 at 11:50 pm
Have you considered writing an SSRS report? You can use a table to get the datasheet and a matrix to get the pivot table. You can the schedule...
August 10, 2010 at 4:22 pm
I'm comparing the difference in months between the zero date and each date, dividing that by four (using integer division) and then subtracting the two values.
DateDiff(Month, 0, FirstDateField)/4 - DateDiff(Month,...
August 10, 2010 at 2:40 pm
ColdCoffee (8/10/2010)
declare @tab table
(
rid int identity(1,1),
starttime datetime,
endtime datetime
)
insert...
August 10, 2010 at 12:46 pm
Rob Schripsema (8/9/2010)
The date field has 00:00:00 for the time, and the time field contains spurious dates (maybe the date the value was entered? or are they all '1-1-1900',...
August 9, 2010 at 3:13 pm
You haven't given enough information. Check the following link on how to help people answer your question.
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Drew
August 9, 2010 at 10:36 am
Jeff Moden (8/8/2010)
drew.allen (8/7/2010)
Here's an example using the Information_Schema.Tables view. WARNING: XML is case sensitive
Thanks, Drew. Rumor has it that it's also pretty touchy about special characters like...
August 9, 2010 at 7:11 am
Tara-1044200 (8/6/2010)
so how would i check the updated...
August 8, 2010 at 1:55 pm
When creating dynamic SQL, it's a good idea to use the Quotename() function to appropriately quote table names, field names, et al. Quotename will automatically handle escaping the quote...
August 7, 2010 at 4:57 pm
I've actually started using the FOR XML clause to create the data and then using sp_xml_preparedocument and OPENXML() to read the data. Here are some of the reasons that...
August 7, 2010 at 4:31 pm
If you want to improve your chances of getting help, you really should post the DDL statements to create your tables and the DML statements to insert sample data into...
August 7, 2010 at 3:53 pm
Jeff Moden (8/5/2010)
drew.allen (8/4/2010)
Even though dates are stored as real numbers, you really should be using DateAdd().Drew
Whether I agree with such claims or not, such claims should be accompanied by...
August 5, 2010 at 7:35 am
Eugene Elutin (8/4/2010)
declare @ReqDate datetime
set @ReqDate = '20100806' --GETDATE()
select LF-(7*wn)-(6) BeginDate, LF-(7*wn) EndDate, LF-(7*wn) PeriodEndingDate
from
(SELECT dateadd(dd, (DATEDIFF(dd,'1900-01-01',@ReqDate - 4) % 7 ) * -1,...
August 4, 2010 at 5:43 pm
Viewing 15 posts - 3,931 through 3,945 (of 4,087 total)