Results 1 to 6 of 6
  1. #1
    jungmanish is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    2

    Question Hour Minute Format not time specific


    In my table of i need to input hours and minute as part of Flight Hours. But as it is associated with timezone i cannot calculate accumulative hours as it end with 24 hours format.
    Where i need to input flight hours in Flight Logbook Database table. Fields Flight Hours, BF AFH, BF EH, AF TSN and Engine TSN are to changed to hour minute.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Are you inputting start and end times and calculating elapsed time?

    Either input all in GST or have a lookup table of the hours difference for each timezone and include that in elapsed time calculation to adjust the saved time to GST.

    But if elapsed time will cross midnight, really need date component saved as well.
    Last edited by June7; 05-06-2018 at 11:38 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Apr 2017
    Posts
    1,687
    Too little info to be sure how you store the time, but in case flights start and end in different Time zones, and on different dates to boot, I would:
    1. Save all times in datetime format (date and time);
    2. Have calculated field(s), where flight leaving and arrival times (datetime) is calculated in Greenwich Time. I.e. all leavings and arrivals are entered at local time + time zone is entered or read from airport registry, and Greenwich Time is calculated based on those data. All flight Hours etc. are calculated from Greenwich Time.

    Probably you have to calculate separately hours, minutes (and seconds when needed) for all those time values, (or you calculate those time values e.g. in seconds to save in table, and calculate hours/minutes for reports when you need them). (You need this trickery because unlike Excel, for Access Microsoft don't support formats like "[h]:mm:ss".)

  4. #4
    jungmanish is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    2
    Hi
    I want to input data in hh:mm format with value greater than 24:00 as its cumulative hours so can be any value
    for example
    Date HH:MM
    May 1 50:10
    May 2 53:20

    Right now i am not being able to enter hours above 24:00 as it is taking it as time not as hour and minute

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by jungmanish View Post
    In my table of i need to input hours and minute as part of Flight Hours.
    It depends on if you need a time or a duration.

    If you write 12:12 pm, that is a time.
    If you write 13:12, that is a time. (NOT 13 hours and 12 minutes)
    If you write 12 hours and 12 minutes, that is a duration

    If you write 50:10, that is meaningless. It is not a time nor a duration (because of the colon)
    If you write 50 hours and 10 minutes, that is a duration.


    To enter hours and minutes, you need 2 fields - one for hours and one for minutes.

  6. #6
    Join Date
    Apr 2017
    Posts
    1,687
    Quote Originally Posted by jungmanish View Post
    Hi
    I want to input data in hh:mm format with value greater than 24:00 as its cumulative hours so can be any value
    for example
    Date HH:MM
    May 1 50:10
    May 2 53:20

    Right now i am not being able to enter hours above 24:00 as it is taking it as time not as hour and minute
    You can enter time interval as
    FlightDate TotalTime
    01.05.2018, 02.01.1900 02:10
    02.05.2018, 02.01.1900 05:20

    Or when those time intervals are totals over flights in given date, you enter info as
    FlightDate FlightNo, FlightStart, FlightEnd
    01.05.2018 1 01.05.2018 02:00 01.05.2018 23:00
    01.05.2018 1 01.05.2018 05:00 01.05.2018 20:00
    01.05.2018 1 01.05.2018 12:00 01.05.2018 22:00
    01.05.2018 2 01.05.2018 16:00 01.05.2018 20:10
    02.05.2018 1 02.05.2018 02:00 02.05.2018 23:30
    02.05.2018 1 02.05.2018 05:00 02.05.2018 21:10
    02.05.2018 1 02.05.2018 12:00 02.05.2018 22:30
    02.05.2018 2 02.05.2018 16:00 02.05.2018 21:10

    And then to get total times (with same result as above) you run a query like
    Code:
    SELECT FlightDate, SUM(FlightEnd-FlightStart) AS [TotalTime], INT(SUM(FlightEnd-FlightStart)*24) AS TotalHrs, ((SUM(FlightEnd-FlightStart)*24) - INT(SUM(FlightEnd-FlightStart)*24))*60 AS TotalMin GROUP BY FlightDate
    The 3rd possibility (You enter sum of flight times for certain plane/route) falls out, as there is now way you having next day over 53 hours of total time for same plane/route

    Edit: This example shows also, why is it better to enter start and end times (with dates), and let Access to calculate time intervals - it is at least weird for user to enter dates at start of past century all time!
    Edit: There was a typo in SQL string what I corrected.
    Last edited by ArviLaanemets; 05-06-2018 at 11:43 AM.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-11-2018, 07:38 AM
  2. Replies: 4
    Last Post: 04-04-2015, 03:28 AM
  3. Query for Specific 24 hour time period
    By esh112288 in forum Queries
    Replies: 1
    Last Post: 10-23-2012, 02:16 PM
  4. Replies: 1
    Last Post: 02-22-2012, 04:59 PM
  5. Time minus one for hour.
    By brianb in forum Queries
    Replies: 2
    Last Post: 03-09-2011, 11:02 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