Viewing 15 posts - 1,966 through 1,980 (of 5,504 total)
In your CTE, add another column that will hold the value of the SEGMENT_SORT column (modified to include leading Zero's) for SEGMENTE_MASTERKEY = 0 values. Place this value column at...
February 6, 2011 at 4:01 pm
What exactly are you trying to do?
Based on your sample data the segment_key=100 has an assigned value of sort=11.
Why should this sort value be listed before a sort=101?
Based on...
February 6, 2011 at 12:26 pm
nzngh (2/6/2011)
February 6, 2011 at 12:12 pm
Nicky Murphy (2/6/2011)
LutzM (2/3/2011)
SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, GETDATE()), 0)
SELECT DATEADD(WEEK, DATEDIFF(WEEK, '19000101',...
February 6, 2011 at 7:49 am
What have you tried so far and where you get stuck?
In general there are two options: using SSIS or plain T-SQL.
Basically, the following steps are required:
Load the file
Validate data
Lookup the...
February 6, 2011 at 3:53 am
Yes, it's possible. The statement after IF "is an expression that returns TRUE or FALSE." (straight from BooksOnLine, the SQL Server help system usually installed with SQL Server).
Another option is...
February 6, 2011 at 3:34 am
I would start with two variables holding the start and end month of the period you're looking for.
Based on that I would build a subquery holding all months within that...
February 6, 2011 at 3:23 am
Duplicate post. No replies please.
Original post: http://www.sqlservercentral.com/Forums/FindPost1059209.aspx
February 6, 2011 at 3:10 am
You could use ROW_NUMBER() OVER(ORDER BY YourColumn DESC) within an CTE and query for Row=1 in an outer SELECT.
Don't think you'd need the CASE statement for it though...
But the question...
February 5, 2011 at 2:49 pm
I'm not fully understand the business case:
You shipped a quantity X on a given day to more than one customer. Wouldn't you need to know the address of each customer...
February 4, 2011 at 3:03 pm
Please provide table def and sample data as described in the first link in my signature togeteher with your expected result.
This will help those of us who prefer testing the...
February 4, 2011 at 1:10 pm
Beside the required changes due to the unusual column names (I had to wrap it in brackets) the following code did work just fine when I tested it:
UPDATE X
SET X.[1ID]...
February 3, 2011 at 4:43 pm
Craig Farrell (2/3/2011)
Is it bad that I consider the 'Don't Feed The Trolls' sign a challenge to see if I can manage to piss off a Troll enough to get...
February 3, 2011 at 4:00 pm
Change of subject:
Anyone of you located in the Chicago area (Jeff?): I hope you folks are all safe and well!!
The news over here show some rather nasty blizzard effects....
Take care,...
February 3, 2011 at 3:54 pm
My first recommendation: since this is a form of presenting the data, I'd trongly vote for doing it at the presentation layer.
If that's not an option, you could use T-SQL...
February 3, 2011 at 2:00 pm
Viewing 15 posts - 1,966 through 1,980 (of 5,504 total)