Viewing 15 posts - 43,681 through 43,695 (of 59,063 total)
bitbucket (5/23/2009)
RBarryYoung (5/22/2009)
bitbucket (5/22/2009)
For those old enough to remember Korean Peace Keeping otherwise known as the Korean War!!!
bitbucket, You're 75???
Nope not 75 ... born April 1932 ... which...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 23, 2009 at 11:23 am
Grant Fritchey (5/22/2009)
Yep, in the Navy on Subs. Hated it, but I'm glad I did it.
Yep... me too! Fast Attacks. Loved the Submarine Service and teaching electronics and...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 23, 2009 at 11:20 am
allister.reid (5/23/2009)
I would be interested in what others...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 23, 2009 at 11:15 am
{approaching sensitive problem very carefully} If I understand correctly, this is a stored proc that processes a single row? If it's used in conjunction with a GUI, that's probably...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 23, 2009 at 8:40 am
Here's to all the men and women in harm's way that can't take time off. Thank you American Soldier.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 22, 2009 at 5:32 pm
Ravi Naik (5/22/2009)
I am working a Developer...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 22, 2009 at 11:07 am
Why not just use "Get External Data" from Excel?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 9:16 pm
shanila_minnu (5/20/2009)
how to get the count of rows in a table...urgent
Interview? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 8:48 pm
Heh... I had to look what "time off" meant.... didn't actually know those two words could be used together like that. 😛
What's a good day off for you?
There's another couple...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 8:46 pm
Jack Corbett (5/20/2009)
SELECT
CASE
WHEN ROW_NUMBER() OVER (ORDER BY P.DAYSTOMANUFACTURE) 2 AND
ROW_NUMBER() OVER (ORDER BY P.DAYSTOMANUFACTURE) < 5 THEN 100
ELSE 75
END AS ROW,
P.PRODUCTID
FROM
PRODUCTION.PRODUCT...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 8:36 pm
Gaby Abed (5/21/2009)
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 8:23 pm
Like this...
[font="Courier New"]--===== Create a test table. This is NOT part of the solution
DECLARE @T TABLE
(
Name VARCHAR(100),
StartDate DATETIME,
Data1 BIT,
Data2 BIT,
Data3 BIT,
Data4 BIT,
Data5 BIT
)
--===== Populate the test table with data.
-- Again, this is not part of the solution.
INSERT INTO @T
SELECT 'Mike' , '05/21/09', '1', '0', '0', '1', '0' UNION ALL
SELECT 'Bruce', '05/21/08', '0', '1', '1', '0', '0' UNION ALL
SELECT 'John' , '09/09/09', '0', '0', '0', '0', '1'
--===== Use STUFF to kill the leading comma on the concatenation
SELECT Name,
StartDate,
STUFF(CASE Data1 WHEN 1 THEN ',Blue' ELSE '' END
+ CASE Data2 WHEN 1 THEN ',Green' ELSE '' END
+ CASE Data3 WHEN 1 THEN ',Yellow' ELSE '' END
+ CASE Data4 WHEN 1 THEN ',Black' ELSE '' END
+ CASE Data5 WHEN 1 THEN ',Violet' ELSE '' END
,1,1,'') AS Colors
FROM @T
[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 7:51 pm
Florian Reischl (5/21/2009)
If the trailing comma is no problem you can remove the @Results table and direct return the data.
Or, use a leading comma and STUFF it just like you...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 7:31 pm
I wouldn't include any of the CASE statements in this query. Calculate all of the common equations in a CTE and then SELECT from that using the column aliases...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 7:09 pm
Josh Turley (5/21/2009)
We have customers using SQL Server Standard/Enterprise, so it'd be easier to teach tech support how to manage one type of RDMBS instead of 2 or 3.
I...
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2009 at 7:02 pm
Viewing 15 posts - 43,681 through 43,695 (of 59,063 total)