Forum Replies Created

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

  • RE: How to divide on row by another

    Steve Jones - SSC Editor (10/26/2011)


    Yes, I think some running total is needed. Something like this: http://www.sqlservercentral.com/articles/T-SQL/68467/

    The problem is that you cannot do the division in the same way as...

  • RE: How to divide on row by another

    Theres no fixed number of channels, it could be anything upwards of 2

    I do have fixed channelIDs which would be in my Insert-Select Statement but for ease of testing Ive...

  • RE: How to divide on row by another

    Steve Jones - SSC Editor (10/26/2011)


    I am getting two rows from your test script, with the values of 48 and 959.999

    Is that correct? It's hard to know what's not working....

  • RE: How to divide on row by another

    basically we have a system that logs data from various devices called channels. Each channel logs data every 30 minutes on the hour and on the half hour.

    occaisionally we want...

  • RE: How to divide on row by another

    Thanks for the heads up...

    Test Data and query

    ---------------------------

    CREATE TABLE #SourceData

    (

    ReadingDateTimedatetime,

    ChannelDatadecimal(18,4),

    UnitAggregationvarchar(50),

    IsMultiplyChannelbit,

    IsDivideChannelbit

    )

    INSERT INTO #SourceData

    (ReadingDateTime, ChannelData, UnitAggregation, IsMultiplyChannel, IsDivideChannel)

    SELECT '2011/01/01 00:00','2','RAW','0','1'

    INSERT INTO #SourceData

    (ReadingDateTime, ChannelData, UnitAggregation, IsMultiplyChannel, IsDivideChannel)

    SELECT '2011/01/01 00:00','4','RAW','0','1'...

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