Results 1 to 3 of 3
  1. #1
    ultra5219 is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Feb 2013
    Posts
    45

    Question how to set data type Time properly

    hi guys.. has anyone knows hows to set time properly data type in table not using Text data type?
    im creating time based on timetable.. is it possible i set the time format like this on access 2007?
    Time format:
    8:00 AM-9:00 AM
    9:00 AM-9:30 AM
    10:00 AM-10:30 AM
    10:30 AM-11:00 AM
    11:00 AM-12:00 PM
    2:00 PM-2:30 PM
    2:30 PM-3:00 PM
    3:00 PM-3:30 PM


    3:30 PM-4:00 PM
    4:00 PM-4:30 PM

    Reasons i want to set these time format on access 2007 is when im creating forms under combo box selecting TIME for timetable class.
    help me how to set this data type..
    Thanks

    Attachment 11409

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Well, what you're showing isn't actually a time, it's a range, so the date/time data type can't handle it. To use the date/time data type, I'd have 2 fields, for the start and end times. You could then concatenate those to get the "look" of what you have there, while still storing actual times.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    looking at the image i am guessing...

    what the person has done is in the combo box he/she has used value list. using value list you can input ur own variables, seperated by semi-colon.

    8:000AM - 9:00AM;9:00AM - 10:00AM;11:00AM - Noon

    now what i think the person did next is ...

    - use two hidden textbox, and used the afterupdate event to set the two time values in those hidden textbox. for eg. if [text1] = "8:000AM - 9:00AM" then setvalue [time1] = 8:00 and [time2] = 9:00

    now when you have the date and the time range you can run queries smoothly.

    access uses 24hr time format so you don't have to use am/pm, so 1pm will be 13:00
    Attached Thumbnails Attached Thumbnails time range.jpg  

Please reply to this thread with any new information or opinions.

Similar Threads

  1. run-time error '13' type mismatch
    By teebumble in forum Forms
    Replies: 8
    Last Post: 12-03-2012, 01:18 PM
  2. Run-time error '13': Type mismatch
    By uronmapu in forum Access
    Replies: 2
    Last Post: 07-10-2012, 07:59 PM
  3. Replies: 1
    Last Post: 08-07-2011, 07:58 AM
  4. Time not Sorting Properly in Report
    By KrenzyRyan in forum Reports
    Replies: 3
    Last Post: 06-24-2011, 08:56 PM
  5. Replies: 2
    Last Post: 03-18-2010, 08:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums