How do i hold date range(s) in a table? eg. from 2003-09-24 to 2006-03-12

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bugboy
    New Member
    • Sep 2007
    • 160

    How do i hold date range(s) in a table? eg. from 2003-09-24 to 2006-03-12

    I need to have a column or columns hold a date range that i can do date functions on. I could use two columns, "start_date " and "end_date" but i thought there might be a better way.. maybe holding this info in one column.

    And.. if i had more that one date range associated with an item would i need to normalize them into a "dates" table? This would really complicate queries.

    Anybody know?

    Thanks!
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    I would use the 'date_start' and 'date_end' method you mentioned. There is no simpler way, that I can think of (atm).

    If you are using several of these date ranges for a single row in you table, it would be best to put them into their own table and add a foreign_key. Especially if you don't know beforehand how many of these ranges each row will have or if the number varies between rows.

    Comment

    • bugboy
      New Member
      • Sep 2007
      • 160

      #3
      Thanks Atli! I was wishful thinking :)

      Comment

      Working...