Viewing 15 posts - 2,986 through 3,000 (of 8,731 total)
Based on your sample data, this should work for you.
Select MemberNbr
FROM #MemberMonthHistory
WHERE EFFECTIVEMONTH < @monthyear
AND EFFECTIVEMONTH >= CONVERT( char(6), DATEADD(MM, -9, @monthyear + '01'), 112)
GROUP BY MemberNbr
HAVING COUNT(DISTINCT EFFECTIVEMONTH) =...
April 25, 2016 at 10:40 am
mw112009 (4/25/2016)
Your solution is close but not perfect.
Select distinct MemberNbr
FROM MHPDW.edw.[MEMBER].[MemberMonthHistory]
WHERE PlanCode IN ( 'MMP','MCR' )
AND EFFECTIVEMONTH in ( SELECT CONVERT( char(6), DATEADD(MM, -n, @monthyear + '01'), 112)
...
April 25, 2016 at 9:51 am
I was going to suggest using a tally table to create one row for each possible month. But that was only because the format MMYYYY doesn't work with ranges. When...
April 25, 2016 at 9:32 am
Ed Wagner (4/25/2016)
Jeff Moden (4/24/2016)
TomThomson (4/22/2016)
Phil Parkin (4/22/2016)
Eirikur Eiriksson (4/22/2016)
Brandie Tarvin (4/22/2016)
April 25, 2016 at 6:23 am
There's a sentence construction very common in Spanish. I did my best on understanding the question, but there's a lack of information to give any advice.
April 24, 2016 at 10:41 am
Let me see if I understand. You're moving data from one database to another and you want to know which data was moved? Do you want to identify the data...
April 24, 2016 at 10:38 am
The values clause is used to have the sample data. In your actual query, you don't have to define the table again. I had to use it have something to...
April 22, 2016 at 8:18 pm
mw112009 (4/22/2016)
See attached,
The instance that has the name starting with WSJ.. is my local PC name. However I also tried Connect ( from menu ) and...
April 22, 2016 at 1:09 pm
shawn 20335 (4/22/2016)
Table A
type x1 x2 x3
A...
April 22, 2016 at 12:59 pm
Please post DDL (CREATE TABLE statement) for the table.
Edit:
Correct your sample data, be sure it runs correctly.
Also, share what you're trying to do with this data. You might not need...
April 22, 2016 at 12:30 pm
I agree on the part that UPPER should be removed if the collation is case insensitive.
The other thing that would improve the query is if you avoid joining tables from...
April 22, 2016 at 12:28 pm
Here's the code for what I mentioned yesterday. Instead of creating rows for every single day, I create rows per week. This is also independent from settings, so it would...
April 22, 2016 at 6:59 am
Based on what you posted, here's an easy way to accomplish it. Notice that I changed your recursive CTE into something more efficient. I also removed all the calculations and...
April 21, 2016 at 12:35 pm
Gary Varga (4/21/2016)
BWFC (4/20/2016)
Gary Varga (4/20/2016)
Maybe it is...
April 21, 2016 at 12:20 pm
Viewing 15 posts - 2,986 through 3,000 (of 8,731 total)