Results 1 to 7 of 7
  1. #1
    rameshmeena is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Location
    Riyadh
    Posts
    16

    How can i enter value in a Time field which is more than 24 hours

    I have one field in my Data base called " Totaltime" which is used to enter the total hours required to finish cutting works. Each cutting works time will be different . I cant enter the cutting time which is more than 23:59 hours. some time the cutting time will be 36 hours etcc. Also i need a report by end of every week to sum of the cutting time, to know how many hours the machine worked. But the total of "Totaltime" field is not showing the value more than 23.59 hrs. so please suggest me a solution to solve this issue,

    Need your support badly


    Ramesh

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    a time field is stored as a decimal number - the date is before the decimal point and the time is after the decimal point and expressed as a percentage of the number of seconds in the day (86400) and now (09:49) would be .409224537 - so can never be greater than 1.

    36 hours would be 1.5 (i.e. 1 day, 12 hours).

    As to the solution, depends on what users can enter for cutting time. If it is always a round number of hours, then suggest you change the cutting time field to a double so users would enter 36. You can then add this to the cutting start time to determine the end time by using the formula

    endtime=starttime+(cuttingtime*3600/86400)

    or

    endtime=dateadd("h",cuttingtime,starttime)

  3. #3
    rameshmeena is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Location
    Riyadh
    Posts
    16

    sample data base - please solve it

    thank you very much for your reply. Can you please check the sample database. and show me how can i do this.

    Regards

    Ra,esj
    Attached Files Attached Files

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Use Numeric datatype instead of datetime for Totatime? Maybe input format to use 2 decimals ##.##. Or use 2 fields, one for hours and one for minutes. At the end you could divide the total minutes by 60 to get the hours and add that to the main hours total?

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    Can you please check the sample database. and show me how can i do this.
    sorry, don't have time and anyway you have not said what units of time (hours or hours and minutes). Perhaps Bulzie has time?

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    For the data you want to capture, you cannot use a Date/Time type. A Date/time represents only a specific point in time - it cannot be used to capture an amount of time, e.g. how many hours/days/.. etc.

    As Bulzie has suggested, change the data type to single or double, which you can use to store decimal hours.

  7. #7
    rameshmeena is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Location
    Riyadh
    Posts
    16

    Thumbs up

    Quote Originally Posted by John_G View Post
    For the data you want to capture, you cannot use a Date/Time type. A Date/time represents only a specific point in time - it cannot be used to capture an amount of time, e.g. how many hours/days/.. etc.

    As Bulzie has suggested, change the data type to single or double, which you can use to store decimal hours.
    thank you very much.. The problem is solved as per suggestion of Bulzie.

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

Similar Threads

  1. Shift time defaulting to 2 hours
    By bradp1979 in forum Programming
    Replies: 5
    Last Post: 07-31-2015, 04:17 PM
  2. Replies: 7
    Last Post: 10-05-2013, 08:43 AM
  3. Enter current date and time into subform field
    By tonybrecko in forum Forms
    Replies: 8
    Last Post: 06-16-2013, 09:58 PM
  4. Replies: 4
    Last Post: 08-06-2012, 10:25 AM
  5. Calculation for time x hours in table
    By hellojosie in forum Access
    Replies: 6
    Last Post: 11-20-2011, 01:54 AM

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