Sum of fields by date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Howard Theunissen
    New Member
    • Jul 2007
    • 2

    Sum of fields by date

    Good day everyone

    I have tried to do the following, and if any can help give guidance it would really be appreciated:

    I have a Form where I input details of a vehicle test by date.

    e.g.

    01 July 2007 , Route 1 , 50km
    02 July 2007 , Route 1 , 50km

    where the date and distances are in individual text boxes in a third box I have the total distance added = 100km's.

    However, sometimes a vehicle will do two different routes on the same day

    e.g.
    03 July 2007, Route 1 , 50km
    03 July 2007, Route 2 , 75km

    Now total distance = 225km's

    But, in a fourth text box I would like to have the distance covered for the day
    e.g. 03 July 2007, Route 1 + Route 2 = 125km's.

    It is this final step that I cannot get right. How do I add the two distances based on the same date?

    Thanks for your help.

    Howard
  • garethfx
    New Member
    • Apr 2007
    • 49

    #2
    Im hoping that Im on the right track to help here as I.m assuming some points

    first teh assumptions

    You have a flat file database and not a relational

    The system you require needs a relational.

    The vehicle requires a specific identifier - registration vehicle number (UK) Tag number USA. both these are best used in theri own situation.

    The one table carries the vehicle ID and the routes, dates and distances are set in another table ID tabe (1 to many) Routes table

    You can then set up the a form to enter the veicle ID and in a subform the details of the dates , distance routes.

    On the main form then have it sum up the distance for the vehicle on a certain date

    Gareth

    Comment

    • Howard Theunissen
      New Member
      • Jul 2007
      • 2

      #3
      Originally posted by garethfx
      Im hoping that Im on the right track to help here as I.m assuming some points

      first teh assumptions

      You have a flat file database and not a relational

      The system you require needs a relational.

      The vehicle requires a specific identifier - registration vehicle number (UK) Tag number USA. both these are best used in theri own situation.

      The one table carries the vehicle ID and the routes, dates and distances are set in another table ID tabe (1 to many) Routes table

      You can then set up the a form to enter the veicle ID and in a subform the details of the dates , distance routes.

      On the main form then have it sum up the distance for the vehicle on a certain date

      Gareth

      Hi Gareth

      Thanks for the response, I was trying to get arround setting up the database that way, the only problem is that at the moment it is already a sub-form, and as far as I know you can't have a subform in a subform. So I will have to tackle this from another angle.

      Thanks

      Howard

      Comment

      Working...