Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005

    Unanswered: choosing field type for time data

    Dear All

    I want to deal with "time data". what's the best data type to be used in table creation for storing "time data" in table not "date part". Only time should be add in table.

    this "time data" than used in airthematics for calculation of tome i.e. difference of hours, minutes etc.

    I used date type but it stores date also as 00.00.00.

    Then I used number type and use data as 1800 but didn't get result.

    Any help please.


  2. #2
    Join Date
    Mar 2008
    It depends firstly on which database you are using / planning to use...

    But without that info, I would say generally there is always the messy way of storing the time as a char or varchar data type, and use conversions, triggers or check constraints to store only the time part of an input.
    Also timestamp types are available in many databases, which contain the date and time down to milliseconds etc, but would need the date cut out at application/query level.
    "My brain is just no good at being a relational Database - my relations suck real bad!"

  3. #3
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    As Oracle DATE datatype contains both date and time (up to seconds), I guess that table column datatype might be DATE.

    A form item datatype may be set to "Datetime", having format mask set to hh24:mi:ss. It will display information as "time" (no date component). Date will, in this case, be truncated to the first of January of the current year.

    You can not avoid storing both date and time, but you can choose what to display.

Posting Permissions

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