Viewing 15 posts - 3,091 through 3,105 (of 5,504 total)
Since we don't have a table including sample data, your request to "go over the intire table" simply returns an error.
Like I stated before: please provide DDL and sample data...
July 21, 2010 at 2:41 pm
Something like this?
SELECT DATEADD(MONTH,DATEDIFF(MONTH,0,GETDATE())-2 ,0),GETDATE()
July 21, 2010 at 2:36 pm
Would you mind providing a few more details, please?
Read to use format preferred (see the first link in my signature for details). Also, please include your expected result based on...
July 21, 2010 at 2:07 pm
Assuming the undelete option fails:
Did the SQL Server copy/forward/transfer any data to other systems and/or did it receive any data from other sources (e.g. other DBs, flat files or the...
July 21, 2010 at 1:56 pm
If you know the number of values you could use the CrossTab method as an alternative to PIVOT.
The advantage: Once you know the basics behind CrossTab you could explore DynamicCrossTab...
July 21, 2010 at 1:44 pm
I'm guessing your values are separated by a space?
If so, search this site for a split string function (e.g. search for "DelimitedSplit8K").
This function is the fastest (T-SQL) way I know...
July 21, 2010 at 12:14 pm
I would wrap the XML shredding into a CTE or subquery and use ROW_NUMBER to get it sorted as required:
;WITH cte AS
(
SELECT
title.value('E[1]','VARCHAR(100)') AS title,
row.value('1+count(for $a in . return $a/../*[....
July 21, 2010 at 12:00 pm
Please provide table DDL, sample data and expected result set based on the sample.
Please read and follow the first link in my signature for posting data in a ready to...
July 21, 2010 at 11:17 am
How abouth the following solution?
DECLARE @date DATETIME
SET @date=GETDATE()
SELECT
CONVERT(CHAR(10),DATEADD(wk, DATEDIFF(wk, 0, @date - 7*n), -2),103)
+ ' - '
+ CONVERT(CHAR(10),DATEADD(wk, DATEDIFF(wk, 0, @date - 7*(n-1)), -3),103)
FROM
(
SELECT 1 AS n UNION ALL
SELECT...
July 20, 2010 at 3:09 pm
You would need to add the reference to the TTITLE section:
SELECT
title.value('E[1]','VARCHAR(100)') AS title,
row.value('1+count(for $a in . return $a/../*[. << $a])','INT')-2 AS ROW,
col.value('1+count(for $a in . return $a/../*[. << $a])','INT')...
July 20, 2010 at 1:34 pm
Here are two options you could use:
--check for first name used as the first part of the last name
SELECT *
FROM @tbl
WHERE LastName LIKE RTRIM(Fisrtname)+' %'
-- check for a space...
July 20, 2010 at 12:30 pm
It doesn't really sound like a normalized table design...
Therefore, you might need to use some T-SQL code to UNPIVOT the data, sort it and PIVOT or CrossTab it back in...
July 20, 2010 at 12:19 pm
Sagar Sawant (7/20/2010)
Solved this query problem.Sagar
Would you mind posting your solution? It's not only good forum etiquette.
It might also help people solving a similar issue. Or you might even end...
July 20, 2010 at 12:16 pm
Hi Graham,
😛 It's not my fault!! Jeff started it!! (or at least he's the one wroting the related article I usually refer to...) 😛
But before giong all crazy make sure...
July 20, 2010 at 11:53 am
Jeff Moden (7/19/2010)
...Heh... looking back at some of the posts, I might be sorry for jumping in here. 😛
Nothing to be sorry for!! You might be late but your...
July 19, 2010 at 5:18 pm
Viewing 15 posts - 3,091 through 3,105 (of 5,504 total)