Results 1 to 3 of 3
  1. #1
    gazandwiz is offline Novice
    Windows 7 64bit Access 2002
    Join Date
    Jan 2016
    Posts
    2

    Question summing time data in many date selectable records.

    Hi all,
    I have a large Access 2003 db that I use for logging my flying airtime.
    The main table has a date field and an airtime field both are Date/Time data types.
    My log book has flights from 1994 to the present time.


    I'd like to be able to add all the hours up for each year, so that I can quickly compare the yearly totals.

    At the moment I have a query for hours 2015 that takes the Date field from table FLIGHTLOG, tick box for show is ticked and the criteria is Between #01/01/2015# And #31/12/2015# then from the Duration field from Table FLIGHTLOG I have the Show box ticked. This fills a table with all the dates I flew and the duration. I then have another query that sums the hours from the previous query. Sum([Duration]*24), Total: expression and ticked show box.
    If I want to do this for all years back to 1994 and for future years, is there a more elegant way of doing it rather than duplicating the two queries and substituting the year?

    Many thanks in anticipation.
    Gary

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    turn on grouping/counting

    select year([date]), sum([hrs]) as Hours from table

  3. #3
    gazandwiz is offline Novice
    Windows 7 64bit Access 2002
    Join Date
    Jan 2016
    Posts
    2
    Thanks, I'll give it a go and report back.
    Cheers
    Gary

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

Similar Threads

  1. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  2. Replies: 3
    Last Post: 03-11-2014, 07:32 PM
  3. Summing Multiple Queries & Summing Time
    By WEJ in forum Queries
    Replies: 2
    Last Post: 10-04-2013, 04:46 PM
  4. Replies: 3
    Last Post: 06-18-2013, 08:17 PM
  5. Date Selectable limitations
    By Robert_Clash in forum Access
    Replies: 0
    Last Post: 11-27-2007, 09:00 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