SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast rad2004's Avatar
    Join Date
    Aug 2004
    Location
    UK
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Date vs. Int Column type

    Hello,

    I am designing a table which will store among others the members date of birth. Assuming this birthdate column will be used a lot in queries (find member between min.age and max.age) I would appreciate some help in deciding what column type would be better.

    1. Date (e.g. 1980-12-01)
    2. Int (e.g. 19801201)
    3. Any other suggestions?

    Thank you

  2. #2
    SitePoint Zealot Vogelfrei's Avatar
    Join Date
    Jan 2004
    Location
    west of the divide
    Posts
    154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I prefer to use a DATE type because it will allow me to use MySQL's native date manipulation functions, if necessary.

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    yeah, in this case they would be necessary
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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