Results 1 to 2 of 2
  1. #1
    dreed64997 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    4

    combine values from specific records then list those records showing totals for each

    I have created a database for keeping my trip and mileage records for my transportation business so I can print out my fuel tax report by state. The table I have is called tblhighways. The fields are HighwayID, StateId (Which gets its information from tblstate), odometerstart, and odometerend. On the form I have a field to calculate the miles for the state, but I want a query that will calculate the mileages for each state then combine that value for each state without having to do it by having to enter each state separately as a search criteria, then show a listing of the total for each state without showing the state more than once. The query will show the results for a 3 month period.

    Any help would be appreciated.
    .

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    a form, (frmRpts) will have 2 dates, txtStartDate, txtEndDate
    qsMiles, will pull data from these dates
    select state, [odoEnd]-[odoStart] as Miles where [date] between forms!frmRpts!txtStartDate and forms!frmRpts!txtEndDate

    qsMilesTotal, will use the query above
    select State, Sum(Miles) as TotalMiles from qsMiles

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

Similar Threads

  1. Replies: 7
    Last Post: 04-02-2015, 07:25 AM
  2. Replies: 6
    Last Post: 11-27-2014, 03:21 AM
  3. Replies: 1
    Last Post: 04-04-2013, 11:59 AM
  4. Replies: 1
    Last Post: 03-13-2012, 06:11 PM
  5. Replies: 7
    Last Post: 12-07-2009, 07:27 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