Forum Replies Created

Viewing 15 posts - 2,986 through 3,000 (of 8,731 total)

  • RE: SQL help needed

    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) =...

  • RE: @TrumpDBA!

    IMO, that account is hilarious. 😀

  • RE: SQL help needed

    mw112009 (4/25/2016)


    Luis C:

    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)

    ...

  • RE: SQL help needed

    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...

  • RE: Are the posted questions getting worse?

    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)


    In this case I did add my two cents because I've seen that damn failure before and it took...

  • RE: Are the posted questions getting worse?

    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.

  • RE: database problem

    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...

  • RE: Convert multiple matrices in one table to multiple row vectors using SQL

    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...

  • RE: How do I install AdventureWorks in my local PC

    mw112009 (4/22/2016)


    Yep It did that !

    See attached,

    The instance that has the name starting with WSJ.. is my local PC name. However I also tried Connect ( from menu ) and...

  • RE: Convert multiple matrices in one table to multiple row vectors using SQL

    shawn 20335 (4/22/2016)


    How would I use SQL to present data in tableA into a row vector here is an example:

    Table A

    type x1 x2 x3

    A...

  • RE: How to Find Percentage using a recursive cte

    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...

  • RE: Stored Procedure Slow

    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...

  • RE: Mondays and Sundays of the month

    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...

  • RE: Mondays and Sundays of the month

    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...

  • RE: Byte Me: Inadequate Cooling

    Gary Varga (4/21/2016)


    BWFC (4/20/2016)


    Gary Varga (4/20/2016)


    Picasso did surrealist paintings where items looked as though they had melted. The artist is matching this with the IT issue of cooling.

    Maybe it is...

Viewing 15 posts - 2,986 through 3,000 (of 8,731 total)