1 Replies - 2829 Views - Last Post: 08 December 2015 - 02:43 PM Rate Topic: -----

#1 miki89  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-December 14

How to insert dynamic table with time values?

Posted 07 December 2015 - 08:56 PM

I have a question about inserting dynamic table with time values. Here is example of the table that I have to insert in db:
Schedule for 12/15/2015
08:30 AM - 09:30 AM     Remove
09:30 AM - 10:30 AM     Remove
10:30 AM - 11:30 AM     Remove
11:30 AM - 12:30 PM     Remove
02:30 PM - 03:30 PM     Remove


I do not have a problem to insert values if my time difference is always the same. Like first few time slots are increased for 60 min but then I have a gap from 12:30pm all the way until 2:30pm. My problem is there. I do not know what is the best way to save these values. Since values are created dynamically and all of them are linked to the same date. If I do not have time breaks that would be really easy but in this case where I have time gap looks really complicated. If anyone can tell me what is the best way to store this in database please let me know. For now I just store start time, end time, date and interval that my time increase each time. That looks like this:
ID  Date        Start               End              Interval
4   2015-12-15  08:30:00.0000000    15:30:00.0000000    60  


In this case If I want to pull out values with the query and display time slots in the table I'm only able to do that with 60min intervals. But I have a gap from 12:30PM until 2:30PM. That gap always can be different depends on user wish. Also I was thinking to insert each record in the table row, but I could not figure it out how to pass all values from the table because I created my table dynamically based on start, end time and interval. For that I used cfloop.

Is This A Good Question/Topic? 0
  • +

Replies To: How to insert dynamic table with time values?

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: How to insert dynamic table with time values?

Posted 08 December 2015 - 02:43 PM

Welcome to DIC miki89. While I'd be pleased to help you, I don't believe you've actually asked a question I can answer. "How to insert dynamic table with time values"? I'm not sure what you mean here.

Perhaps you might be a little more clear on what you're trying to accomplish, what you've done before that worked ("I do not have a problem to insert values if my time difference is always the same") and what the difference is between the two.

Consider posting an example of the code you used that worked and then explain how that isn't sufficient for what you're trying to do.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1