Viewing 15 posts - 526 through 540 (of 4,087 total)
My first thought is unprintable characters, e.g., tabs. I usually cast to binary to see if the binary data matches what I'm expecting.
Drew
May 23, 2019 at 3:33 pm
You're overlooking the obvious. There is a QUARTER date part. This becomes simple if you use that.
CASE WHEN DATEDIFF(QUARTER, c.DATEKEY, @TodaysDate) = 0 THEN 1 ELSE 0...
May 23, 2019 at 3:14 pm
I didn't round my results, but otherwise this gives the same results. I also had to add extra values to the table to get all of the dates that you...
May 20, 2019 at 5:04 pm
Thanks for the tip Drew, I've made the change to the code.
I see you updated the LAST_VALUE()
, but not the FIRST_VALUE()
. The default isRANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT...
May 16, 2019 at 6:52 pm
It's simple enough to test. Have you done so?
Drew
May 16, 2019 at 3:19 pm
So just a couple tips for the next time you post. Make sure you put any DDL statements in a code block so its easier to read. Most people...
May 16, 2019 at 3:02 pm
CREATE table #AllCountryStates ( CountryName NVARCHAR(100), Treeid int ) insert INTO #AllCountryStates select N'??',1 select * from #AllCountryStates declare @Country NVARCHAR(1000) SELECT @Country = STUFF( (SELECT ',' + '
May 16, 2019 at 2:50 pm
Hi all, Been going mad most of today with trying to retrieve CoverType from the below XML data: If anyone could point me in the right direction it would...
May 15, 2019 at 4:12 pm
An rCTE is probably one of the worst ways to build a set of intervals. You are much better of using a tally table with LEAD()
or LAG()
.
May 15, 2019 at 3:55 pm
There isn't a lot of info here and it seems like someone was already helping you on a previous thread. However, if you are just looking for a method...
May 8, 2019 at 7:54 pm
You're getting that error message, because the scope of the alias c is the sub-query, and you are trying to use that alias outside of its scope.
Also, it looks like...
May 8, 2019 at 2:44 pm
Simply saying It's not working
isn't very descriptive. I assume that you mean that you're not getting the data that you expect. Since you haven't provided sample data and expected...
May 8, 2019 at 1:55 pm
You are correct that the distinct is not needed. The USE CCAP was in there twice because i was testing code in SSMS and needed it in the second...
May 7, 2019 at 5:56 pm
There are several issues with this. The primary one is that you have a large number of reads of the same tables. I think that it can be done with...
May 7, 2019 at 3:15 pm
I found this problem in multiple versions. The customer which it is made for is on an older version, however with the same syntax it also gave the strange...
May 6, 2019 at 4:06 pm
Viewing 15 posts - 526 through 540 (of 4,087 total)