SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2004
    Kansas City, MO
    0 Post(s)
    0 Thread(s)

    Question Date & Time fields vs DateTime field

    Quick question here. Though its probably not a huge deal, it might make a performance difference.

    I am working on a database that will store different sporting events (baseball, football, basketball, etc). All of these events will have times for the event. Typically the date and time values will not be viewed together (different table cells for example).

    The way I see it, if I have a DATETIME field then I would require a bit more php processing to seperate the two for display purposes. But using seperate DATE and TIME fields would make my queries a bit longer and possibly(?) take up more storage space.

    I know, I'm probably analyzing this too much. Any input would be great!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Toronto, Canada
    63 Post(s)
    3 Thread(s)
    use DATETIME

    separate DATE and TIME columns, when the values are in fact related, doesn't make sense

    displaying only the date or time portion, or separate date and time portions, is not exactly what i would call a strenuous programming requirement

    you can do it in mysql, too -- you don't have to do it in php | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts