×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Summing by 24hr period - 7am to 7am

Summing by 24hr period - 7am to 7am

Summing by 24hr period - 7am to 7am

(OP)
OK, I'll try and explain this 'logically':

My MS SQL application records outputs from a production line in real time. If I want to sum an output from a particular production line for a time period (say a month) and group by day, that works fine. The problem is that our 'Days' run from 7am to 7am and I need to sum that period and group by date of the start of our 'day'. I know I could add 0.278'ish to each day in the query, but then the query does not give the correct results between midnight and 7am.

What can I do?

RE: Summing by 24hr period - 7am to 7am

You could try subtracting 7/24 of a day from each timestamp - this would make 7 am be 12 am, and 6:59 am be 11:59 pm on the day before.  Then after you have the "day", add the time back to get the actual time.

Hope this helps!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources