Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)

  • RE: SSRS In a Flash

    Very good introduction. I am looking forward to learn basics and then advances options like creating chart, grahphs , automatic emails to user, scheduling etc... Can't wait for the next...

  • RE: Update sortorder column to +1

    Hey Guys,

    Below is the code that I changed for partition purpose. I know simple sql like select and group by etc.. but this is new to me and I really...

  • RE: Update sortorder column to +1

    Sean Lange (8/1/2012)


    This should work with your sample data.

    select *

    from CustomerConditions

    where IsActive = 1

    order by SortOrder

    begin transaction

    update CustomerConditions

    set SortOrder = x.RowNum

    from CustomerConditions c

    cross apply

    (

    select ConditionID, ROW_NUMBER() over (order by isnull(SortOrder,...

  • RE: Update sortorder column to +1

    capn.hector (8/1/2012)


    i have a couple of things in mind but i think the OP is looking for an UPDATE statement. the question i have is that i cant see...

  • RE: Update sortorder column to +1

    Lowell (8/1/2012)


    i think it's simply like this:

    ...ORDER BY ISNULL(SortOrder,2)

    yes it's simple if I have only one record to update but unfortunately I have thousands records like this 🙁

  • RE: Update sortorder column to +1

    kaushal_shah26 (8/1/2012)


    Hi Guys,

    I have a table like this

    Id----------Type--------ConditionId-------isActive------SortOrder

    1001-------860----------2----------------1------------1

    1002-------860----------3----------------1------------0

    1003-------860----------5----------------1------------Null

    1004-------860----------1----------------0------------Null

    1005-------860----------4----------------0------------Null

    There are 3 conditions which are active. Out of those 3 conditions, 2 have sortorder value (1 and 0).

    I need to write...

  • RE: Update sortorder column to +1

    Thanks for the quick response. Below is the script that I used to create table and insert sample data.

    CREATE TABLE [dbo].[CustomerConditions](

    [Id] [int] IDENTITY(1,1) NOT NULL,

    [Type] [int] NULL,

    [ConditionId] [int] NULL,

    [isActive] [bit]...

  • RE: Complecated Sql query

    I figured out the solution. Thanks for the help.

    case when t.FinancialStatus = ''Customer'' then 0 else

    case when (cfc.OriginalCostBase * ccc.mintransferpricepercentage /100) > (cfc.beforeactivationcostusd * ccc.mintransferpricepercentage /100) and

    (cfc.OriginalCostBase *...

Viewing 8 posts - 1 through 8 (of 8 total)