Results 1 to 3 of 3
  1. #1
    Retszat is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    2

    Problem adding short time

    I built a database to track task completion times for aircraft inspections. but now i am having trouble creating usable reports because it does not sum the time correctly after every 24 hrs it goes back to 0001 (times were stored as short time.



    here is an example of how the tables work:

    Aircraft(text--drop down box from another table), InspType(text drop down box), Date(Date), Task(text), StartTime(shorttime) StopTime(shorttime) TotalTime(calculated...[startTime]-1-[stopTime] this enables time to calculate correctly when working past midnight)

    The report builds off a querie that with aircraft and insptype as the vairables....(i have question here too but will ask those later)

    Questions:
    1. For the report I used the report wizard in Access 10 and where the problem occurs is in the summary where i am asking it to sum the TotalTime. if it is less than 24 hours it works great but normally it is not. is there an easy way to allow it to go over 24 hours

    2. right now for the querie i have to know the specific aircraft and specific inspection type. is there a way to make it when it asks for those veriables for them to be a dropdown box showing the available aircrafts and inspections from the maintable?

    3. Also is there a way to make it that if i do not put any info in one of the variable blocks that it gives me all the info for example If i wan a summary of all HSC 1 inspection I would leave the aircraft block blank or if i wanted to see all the inspections against a paticular aircraft i would leave the inspection type blank...

    Could/should questions 2 and 3 be done on the reportsForm vs the acual report with a button to run the report with the data from the form? These 2 are secondary to my main problem...I could write diffrent querries for these i suppose......

    Thanks for your time

  2. #2
    Retszat is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    2
    Ok I found an answer to my #1 question.....Here it is for those of you who were looking for an answer and i did it without any VB Code...

    First in the Query I added a block on the end that as follows: TotalMin: DatePart("h",[TotalTime])*60+DatePart("n",[TotalTime])
    Then on the report where i wanted the total time calculation rather that the wizards =Sum([TotalTime]) I put the following:
    =Str(Int(Sum([TotalMin])/60)) & ":" & Mid(Str(Sum([TotalMin])-(Int(Sum([TotalMin])/60)*60)),2,2)

    What doing this does is in the Query the formula changes the short time to total minutes and then in the report it changes it back to short time format allowing me to have more than 24 hours....

    But I still need help with the 2nd two questions. but to clarify the way my database is set up I created a welcome form, a Form for the user to input data and a 3rd form for reports. In the data input form i made it so that the aircraft and inspection type are both drop down boxes that list only the available aircraft tail numbers and the inspection types....but when i run the report you have to know the aircraft tail number and type inspection if you mistype any of the info it will give you a blank report. Is there a way to either put the drop down boxes on the Reports form and tie that to the parameters of the querry or to make the querry when asking the parameters for it to be drop down boxes.....

    and 2nd (this would be nice if i could do it) If i leave one of the two parameters blank Could it list them all....For instance if i wanted the report to give me show me summarys for all the inspections on one aircraft or the other way around if i wanted summarys on all the HSC 1 inspection on all the aircraft Tails?.... Any help here would be apreciated Thanks

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for sharing your solution. It is more useful in these forums to only list one issue per thread. You will get answers faster.
    If you did not know about them, here's a couple of links you may find helpful:
    http://support.microsoft.com/kb/q130514/en-us
    http://access.mvps.org/access/datetime/date0009.htm
    BTW: If the field is a DateTime field then "Short Time" is simply a display option and not a storage option.

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

Similar Threads

  1. Adding Time help
    By Bozilla in forum Forms
    Replies: 3
    Last Post: 11-08-2011, 09:18 AM
  2. Dealing with Short Time format
    By hawkins in forum Access
    Replies: 0
    Last Post: 08-16-2011, 11:46 AM
  3. adding time & date
    By tyekhan in forum Queries
    Replies: 1
    Last Post: 07-21-2011, 08:13 AM
  4. Datepicker set to short date: displays time?
    By sprovoyeur in forum Forms
    Replies: 3
    Last Post: 07-19-2011, 06:24 AM
  5. Adding Time
    By jlclark4 in forum Queries
    Replies: 7
    Last Post: 05-04-2011, 10:35 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