Forum Replies Created

Viewing 15 posts - 316 through 330 (of 637 total)

  • RE: SQL help needed

    Never mind, don't worry, I figured out...

    By including a CTE and joining with it I was able to filter the records..

    Done!

    Good Job, Thanks

    Declare @monthyear as char(6); --yyyymm

    SET @monthyear = '201605';

    With...

  • RE: SQL help needed

    Luis C:

    Slight problem with your second query.

    Certainly It gurantees that the member had a total of 9 records for the last nine months. However it does not gurantee that...

  • RE: SQL help needed

    I see your point,

    So if a member had 9 records and then 2 of them were fro one particular month, then yes it would be inaccurate...

    Thanks I will check to...

  • RE: SQL help needed

    Luis C and others:

    Thanks but I found my solution.....( see below )

    Thanks again for the SQL help.

    Declare @monthyear as char(6); --yyyymm

    SET @monthyear = '201605';

    Select MemberNbr, count(*) as CNT

    FROM

    (

    Select...

  • RE: SQL help needed

    Luis C:

    Here you go ( See attached )

    The attached DDL will create a table and has INSERT statements to cover member data for 2 members. That should be sufficient.

    Hope this...

  • RE: SQL help needed

    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

    Luis C: Thanks

    That original query that I wrote is just for explaining what I was looking for.. Did not

    bother to include perfect syntax.

    Let me try your solution. Thanks again.

  • RE: SQL help needed

    See data attached...

    Member 00028414401 has been enrolled since 201301 onwards.

    For each month he/she gets a row in the table.

    I think this is a simple question but I need the...

  • RE: SQL help needed

    Sorry, please used the SQL below,

    The effectivemonth is in the format YYYYMM

    So please use this syntax

    Declare @monthyear as varchar(4) --yyyymm

    @monthyear = '201605'

    Select distinct MemberNbr

    FROM

    MHPDW.edw.[MEMBER].[MemberMonthHistory]

    WHERE

    PlanCode...

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

    How would I check that ?

    Create a table in one instance and then if both of them are the same the table should appear in both instances right ?

    I checked...

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

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

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

    The person sitting next to me has access to his local machine.

    I think the issue is because I have the STANDARD edition.

    The person next to me updated his to the...

  • RE: How do I add 2 computed columns

    Correct Syntax

    ALTER TABLE [PIHP].[HIST5657]

    ADD

    ServiceFromDatexas CONVERT(CHAR(8),ServiceFromDate,112 ),

    ServiceToDatexas CONVERT(CHAR(8),ServiceToDate,112 )

  • RE: How do I add 2 computed columns

    Here is the error message I get :

    Msg 128, Level 15, State 1, Line 3

    The name "ServiceFromDate" is not permitted in this context. Valid expressions are constants, constant expressions, and...

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

    When I joined here SQL server , SSMS was already installed.

    I don't get any rights to install anything on my PC.

    Unfortunately, the HelpDesk staff is not that helpful (

    Honestly...

Viewing 15 posts - 316 through 330 (of 637 total)