Viewing 15 posts - 391 through 405 (of 4,081 total)
I'm putting this example of an alternative in for reference by future readers. It uses a WeekNo instead of your week ending date, but the logic is...
August 8, 2016 at 1:55 pm
I can't either. Glad you finally got it to work.
August 8, 2016 at 11:56 am
While we are still old school then, I think Cross Applying a VALUES clause is a great trick. Very clean and powerful alternative to UNPIVOT.
August 8, 2016 at 11:49 am
Lynn Pettis (8/8/2016)
The Dixie Flatline (8/8/2016)
https://technet.microsoft.com/en-us/library/ms177443(v=sql.105).aspxMake it easier:
https://technet.microsoft.com/en-us/library/ms177443(v=sql.105).aspx
😛
August 8, 2016 at 11:46 am
I don't get that error message with the sample data you supplied. If your test data has more than one date within the range, you have to...
August 8, 2016 at 6:11 am
Are you trying to sum up the amount of all rows between a range? If so, you need to use the SUM() function in your subquery.
August 8, 2016 at 5:46 am
Any chance of changing the input to make that ["fishing"]?
The error message is that the input is not properly formatted. Making it a one-element array fixes the problem.
August 7, 2016 at 8:18 pm
Here's how the line in question should read.
WHEN CAST(GETDATE() AS DATE) BETWEEN CAST([StartDate] AS DATE) AND CAST([EndDate] AS DATE)
The key is that [StartDate] comes before [EndDate]. ...
August 7, 2016 at 7:54 pm
Sorry for the drama guys. Totally my fault.
I vaguely remember a similar debate about this many years ago. The purpose of these forums are to...
August 7, 2016 at 2:55 pm
Eirikur Eiriksson (8/6/2016)
The Dixie Flatline (8/6/2016)
Answer withdrawn because I prefer not to answer interview questions.Just curious, how do you determine that this is an interview question?
😎
I don't know it for...
August 6, 2016 at 8:36 pm
I just realized you posted 3 questions in 30 minutes. These aren't interview questions are they?
August 6, 2016 at 8:53 am
Answer withdrawn because I prefer not to answer interview questions.
August 6, 2016 at 8:42 am
Could you please at least give an example of what the result should be?
Don't explain it in words, draw us a picture.
Create a result table and populate it with...
August 6, 2016 at 8:26 am
Answer withdrawn because I prefer not to help people with interview questions.
August 6, 2016 at 8:18 am
Viewing 15 posts - 391 through 405 (of 4,081 total)