Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8829973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:57:35+00:00 2026-06-14T07:57:35+00:00

This is what I need the update to do: update my summary table TIME

  • 0

This is what I need the update to do:

  • update my summary table TIME column with the user-edited TIME value
  • compare the new TIME, using ID’s from my summary table and hour_interval table to join tables
  • find the correct row ID where the new TIME falls within (there are two columns with start and end hours; example would be: start column – 04:00:00 end column 06:00:00)
  • update the summary table with the correct interval row ID using the summary table ID

The code executes, but doesn’t update the interval ID. Suggestions?

UPDATE summary S  
JOIN hour_interval H  
ON S.hourinterval_id = H.hourinterval_id 
SET S.hourinterval_id = H.hourinterval_id 
WHERE ('$new_time' BETWEEN H.start_hour AND H.end_hour) 
AND summary_id = '$summary_id'"

hourinterval_id start_hour  end_hour
1               4:00:00 5:59:59
2               6:00:00 7:59:59
3               8:00:00 9:59:59
4              10:00:00 11:59:59
5              12:00:00 13:59:59
6              14:00:00 15:59:59
7              16:00:00 17:59:59
8              18:00:00 19:59:59
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:57:36+00:00Added an answer on June 14, 2026 at 7:57 am

    Try this:

    UPDATE summary S  
    JOIN hour_interval H  
    ON '$new_time' BETWEEN H.start_hour AND H.end_hour
    SET S.hourinterval_id = H.hourinterval_id 
    WHERE summary_id = '$summary_id'"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with a couple of thousand rows: from this I need
I'm modifying demo application from this article: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx I need to update all files
I need to write a report that generates summary totals against a table with
I was trying to update approx 20,000 records in a table by using statements
Summary: We need to duplicate the behaviour of the Add Reference dialog, using DTE,
I have a table of about a million rows and I need to update
I need to modify my xml node value like <summary> <data>125</data> </summary> to <summary>
Here is the summary: I need to build a simple java web app that,
I have a database that I need to connect to and select from. I
Summary : I have a project using GNU Autotools. I have a pot file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.