Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding fields for sub totals (2000)

    I would like to add fields from a table to get a subtotal. Is this possible to do in a query? If so can someone please tell me how? I already have a sum of all fields, but I would like to break down the fields by groups, i.e. group 1000+1200+1250+1300 = X : groups 2000+2100+2150+2200=Y etc.

    TIA
    Bret

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding fields for sub totals (2000)

    On what do you want to base your groups ?
    If it's the thousands, group on <pre>Int([NumberField]/1000)</pre>

    Francois

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding fields for sub totals (2000)

    Thanks for responding;

    I have a table called Departments. The fields in the table are Dept. ID, Descripton, etc. The Dept. ID is the field that I would like to sub total. The department ID's are 1000, 1001, 1002, etc. I want to add all the 1,000's together and get a total all the 2,000's together and get a total, all the 3,000's together and get a total, so on.

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding fields for sub totals (2000)

    In the query you make for the totals, add a column with the expression:
    if the Dept ID field is a text field :
    Departments : Left([Dept ID],1)
    if the Dept ID field is a number :
    Departments : Int([Dept ID]/1000)
    In the line Total make sure Group By is select.
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •