Forum Replies Created

Viewing 15 posts - 16 through 30 (of 53 total)

  • RE: Need to fill the Gaps with previous value

    I'm very thank ful to all .

    Its great pleasure to know all the valueable suggestions and solutions.

  • RE: Need to fill the Gaps with previous value

    thanks jeff for your valuable advice .

    I should change the order by n.date final select as below :

    SELECT CONVERT(varchar(20), N.date , 101) AS DATECOL, T.WEIGHTS

    FROM AllDatesCTE AS N

    ...

  • RE: Need to fill the Gaps with previous value

    Here is the another solution ;

    ;WITH DigitsCTE AS

    (

    SELECT digit

    FROM (VALUES(0), (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS D(digit)

    )

    , AllDatesCTE...

  • RE: Query help to update with next records

    thanks for all for the valuable different methods . which were really help me to think in different perspectives.

    I have gone thorough the all the solutions .

    I...

  • RE: Query help to update with next records

    Jeff Moden (7/22/2012)


    Nagaram (7/22/2012)


    Thanks to all ,

    There's a question in my mind that's still outstanding about all of this. Do you just want to return a result set or...

  • RE: Query help to update with next records

    Thanks to all ,

  • RE: Query Help

    excellent . Thank you ...!

  • RE: Query Help

    No because "ROW_NUMBER() OVER (PARTITION BY REFERENCE_ID, TECH_MODE_ID ORDER BY BEGIN_TIME)" will always evaluate to 1 since REFERENCE_ID is the primary key.

    SSCrazy,

    It will work I think . REFERENCE_ID ...

  • RE: Query Help

    Great Result ...

    Thank you very much ..

  • RE: Query Help

    Wow .. Thanks.,

    This big code working Great .. I will do some testing on this ....

    Thanks a lot

  • RE: Query Help

    venkat_reddy7 (6/13/2012)


    I think you can use below query

    SELECT REFERENCE_ID

    ,TECH_MODE_ID

    ,MIN(BEGIN_TIME)

    ,MAX(END_TIME)

    FROM SAMPLE

    GROUP BY

    REFERENCE_ID

    ,TECH_MODE_ID

    ,CONVERT(VARCHAR(20), BEGIN_TIME, 100)

    I think it will not work in all cases .What will happen if I add another...

  • RE: Query Help

    I am trying with permutation and combinations ... not yet figure out.

    Still trying ..

  • RE: Query Help

    I tried this ...

    But getting same rank for all TECH_MODE 5, Some where partition is missing .

    I am unable figure out it.

    SELECT * , DENSE_RANK() OVER(...

  • RE: Query Help

    The input data always consistent .

    begin_time having incremental date also end_time having incremental date.

    I need to group the Consecutive TECH_MODE records by selecting MIN(BEGIN_TIME) , MAX(END_TIME)

    -- Output...

  • RE: Query Help

    The pattern is consistent ..

    Always BEGIN_TIME of records is greater then the END_TIME of previous record.

Viewing 15 posts - 16 through 30 (of 53 total)