Viewing 15 posts - 646 through 660 (of 3,957 total)
Jeff Moden (3/19/2014)
masoudk1990 (3/18/2014)
Select
(SELECT DOB FROM [Table] WHERE DOB IS NOT NULL) AS DOB,
(SELECT LNAME FROM [Table] WHERE...
March 20, 2014 at 12:09 am
This is similar to the "greedy knapsack" problem (Googleable) but I can tell you flat out it ain't gonna be easy to do in SQL.
March 20, 2014 at 12:04 am
:hehe: I like brain teasers! 😛
Both yours and mine look a bit nasty but I think you can do this with a single MERGE statement:
DECLARE @VendorProductINT ...
March 19, 2014 at 7:04 pm
Just STUFF it:
declare @String varchar(25) = 'asdf-qwer';
SELECT STUFF(@String, 1+charindex('-', @String), 999, '');
🙂
March 19, 2014 at 5:55 pm
SQLRNNR (3/18/2014)
dwain.c (3/18/2014)
Oh God Steve, don't get me started!Good editorial!
Oh please - get started Dwain 😉
If you insist Jason. 😛 Bad code can be judged on many levels (some of...
March 18, 2014 at 6:12 pm
funreal7/brendan woulfe/Kenneth J. Moore/sneumersky,
Thanks to all for taking the time to read and comment. What a great community we have here when everyone takes a moment to contribute.
March 18, 2014 at 5:50 pm
paul.s.lach (3/18/2014)
I liked your analysis of the different options for building a resultset that included both an in-effect and an out-of-effect date, BUT I think you missed the boat on...
March 18, 2014 at 5:47 pm
Sean Lange (3/18/2014)
dwain.c (3/18/2014)
I believe that this article might be relevant to your question:Creating a Date Range from Multiple Rows Based on a Single Date[/url]
As soon as I saw the...
March 18, 2014 at 5:42 pm
I believe that this article might be relevant to your question:
Creating a Date Range from Multiple Rows Based on a Single Date[/url]
March 18, 2014 at 5:28 am
Johan,
Thanks and glad you like it.
As a little additional background, one of the things that led me to write this (besides people on the forums always asking the question), is...
March 18, 2014 at 4:19 am
Duplicate post. I responded to this question here:
http://www.sqlservercentral.com/Forums/Topic1551846-3077-1.aspx
March 17, 2014 at 6:48 pm
While MickyT's solution will work (thanks Micky for the sample data!), I tend to shy away from the window aggregate functions for performance reasons.
WITH SampleData AS
(
SELECT *
FROM (VALUES
(12335,CAST('19900101' AS...
March 17, 2014 at 6:46 pm
Something like this perhaps?
WITH CTE AS
(
SELECT 11011 AS CUSTOMERID, GETDATE() AS LoadDate
UNION ALL
SELECT 11011, LoadDate + 1
FROM CTE
),
Milestones AS
(
SELECT TOP...
March 17, 2014 at 6:34 pm
I agree, nice Spackle article Wayne.
It included a couple of things I didn't know about PARSENAME (because I'm probably one of the ones that underutilizes it), like it returning NULL...
March 17, 2014 at 6:16 pm
Viewing 15 posts - 646 through 660 (of 3,957 total)