Forum Replies Created

Viewing 15 posts - 1,696 through 1,710 (of 6,401 total)

  • RE: Last N Group with Top n for each Group

    serg-52 (11/18/2015)


    Antony,

    and periodid >= (select max(dr)-3 from cte)

    may lead to too much periods returned. Consider periods

    (3,4,5,6,7). Then max(dr) -3 ==2.

    MAX(DR) = 7

    7 - 3 = 4

    >=4 =...

  • RE: Last N Group with Top n for each Group

    Yeah I had a typo, the script should work now, just retested it.

  • RE: Today's Random Word!

    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    djj (11/18/2015)


    Ed Wagner (11/17/2015)


    djj (11/17/2015)


    DonlSimpson (11/17/2015)


    djj (11/17/2015)


    Ed Wagner (11/17/2015)


    crookj (11/17/2015)


    Blizzard (Snow Day)

    Snow Thrower

    Shovel

    Dig

    Work

    Home

    Family

    Fortunes

    Savings

    Interest

    Investment

    Return

  • RE: Last N Group with Top n for each Group

    OK, this is my take on the problem then

    create table #test_period (periodid int, customerid int, closebalance decimal (18,2))

    insert into #test_period values

    (1,1,10.82),

    (1,2,14.67),

    (1,3,15.90),

    (1,4,12345.90),

    (1,5,545.86),

    (1,6,8456.05),

    (1,7,549851.00),

    (1,8,564891.02),

    (1,9,7845.09),

    (1,10,12.23),

    (1,11,74.15),

    (1,12,98.45),

    (1,13,98.99),

    (1,14,931.25),

    (2,1,54.44),

    (2,2,518.54),

    (2,3,8253.25),

    (2,4,455.90),

    (2,5,5575.86),

    (2,6,556.05),

    (2,7,851.00),

    (2,8,891.02),

    (2,9,75.09),

    (2,10,1.23),

    (2,11,7.15),

    (2,12,9.45),

    (2,13,9.99),

    (2,14,91.25),

    (3,1,118.82),

    (3,2,154.67),

    (3,3,155.90),

    (3,4,1345.90),

    (3,5,45.86),

    (3,6,856.05),

    (3,7,59851.00),

    (3,8,56891.02),

    (3,9,785.09),

    (3,10,2.23),

    (3,11,7.15),

    (3,12,8.45),

    (3,13,988.99),

    (3,14,31.25),

    (4,1,174.82),

    (4,2,174.67),

    (4,3,175.90),

    (4,4,127345.90),

    (4,5,5745.86),

    (4,6,87456.05),

    (4,7,5851.00),

    (4,8,891.02),

    (4,9,75.09),

    (4,10,742.23),

    (4,11,7444.15),

    (4,12,9858.45),

    (4,13,99698.99),

    (4,14,95231.25),

    (5,1,1052.82),

    (5,2,12544.67),

    (5,3,15245.90),

    (5,4,1254345.90),

    (5,5,52445.86),

    (5,6,84422456.05),

    (5,7,5449851.00),

    (5,8,56424891.02),

    (5,9,784245.09),

    (5,10,4212.23),

    (5,11,224274.15),

    (5,12,922458.45),

    (5,13,24532.99),

    (5,14,2545.25)

    select * from #test_period

    --Assuming you don't have any gaps in...

  • RE: Today's Random Word!

    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    djj (11/18/2015)


    Ed Wagner (11/17/2015)


    djj (11/17/2015)


    DonlSimpson (11/17/2015)


    djj (11/17/2015)


    Ed Wagner (11/17/2015)


    crookj (11/17/2015)


    Blizzard (Snow Day)

    Snow Thrower

    Shovel

    Dig

    Work

    Home

    Family

    Fortunes

    Savings

    Interest

  • RE: Db Mail not seemingly working

    Check any firewalls (software / hardware) for any outbound rules from your SQL server to your SMTP server for port 25 access (assuming you are using port 25)

    Telnet from your...

  • RE: Last N Group with Top n for each Group

    So you need 40 rows in the output

    top 10 closing balances for each of the last 4 periods?

  • RE: String Function

    Is there only ever 2 | in a given string

    EG, will the string always be something|12345|67890

    or does the number of | change in a given string and could be something...

  • RE: Today's Random Word!

    djj (11/18/2015)


    Ed Wagner (11/17/2015)


    djj (11/17/2015)


    DonlSimpson (11/17/2015)


    djj (11/17/2015)


    Ed Wagner (11/17/2015)


    crookj (11/17/2015)


    Blizzard (Snow Day)

    Snow Thrower

    Shovel

    Dig

    Work

    Home

    Family

    Fortunes

  • RE: Incorrect syntax near DEFAULT

    alter table projects add constraint DF_Projects_CreateUser_SystemUser DEFAULT SYSTEM_USER FOR create_user

  • RE: ** Urgent !!! ** Connection Timeout Expired !

    1- Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: 192.168.128.76]

    Whats the...

  • RE: Sync Tables

    Thanks for that link, will take a look more into CT then

  • RE: Sync Tables

    Phil Parkin (11/18/2015)


    I would think of using Change Tracking.

    Always forget about CDC, just one of them things I have never used so never crosses my mind.

  • RE: Password Change

    From the documentation the only method is to use SQL Server Config Manager.

    This ensure that the new service account is assigned to the correct groups, policies and that the service...

  • RE: Today's Random Word!

    Ed Wagner (11/17/2015)


    anthony.green (11/17/2015)


    whereisSQL? (11/17/2015)


    anthony.green (11/17/2015)


    Ed Wagner (11/17/2015)


    Lei

    Steve Jones

    editor

    Chief

    In Charge

    Overseer

Viewing 15 posts - 1,696 through 1,710 (of 6,401 total)