data calculation

  • Hi,

    We are collection data from a machine for every 10 mins and data from another machine for every 15 mins. But when i calculate hourly summary I am supposed to calcute the sum of all 60 mins data even though i have 6 data points for machine1 and 4 data points for machine2 during that one hour period.

    For machine1 i have data at 5:05 am -120v,

    5:15 - 140v,

    5:25 - 110v,

    5:35 146 v,

    5:45  128v

    and 5:55 - 134v.

     

    Now hjow can i determine the data points for 5:06,5:07,5:08,5:09,5:10,5:11,5:12,5:13,5:14

    Between the time interval 5:05 and 5:14.

     

    Thanks.

  • Hi,

    You should used the between operator used to compare date.

    Declare @Date varchar(30),

    SET @Date = '20061024'

    you can used any date which fulfill your requirement.

     

    WHERE FieldName Between @Date + '05:05AM' AND @Date + '05:15AM'

    You can specified the interval as you need and hope this will slove your problem

    Thanks & cheers

    Ijaz

    cheers

  • Hi,

    You should used the between operator used to compare date.

    Declare @Date varchar(30),

    SET @Date = '20061024'

    you can used any date which fulfill your requirement.

     

    WHERE FieldName Between @Date + '05:05AM' AND @Date + '05:15AM'

    You can specified the interval as you need and hope this will slove your problem

    Thanks & cheers

    Ijaz

    cheers

  • you could create a table such as

    TimeLabel TimeFrom TimeTo

    5:06 5:06 5:07

    5:07 5:07 5:08

    Now just do SELECT TimeLabel, Count(DataPoint)

    FROM DataPoints DP

    JOIN

    TimeSlots TS

    ON

    DP.Time>TS.TimeFrom AND DP.Time<TS.TimeTo

    GROUP BY TimeLabel

    Something along these lines should get you out of trouble.

  • Find school hanbook on Math and read the chapter about interpolation.

    _____________
    Code for TallyGenerator

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

You must be logged in to reply to this topic. Login to reply