Results 1 to 11 of 11
  1. #1
    Mphiri is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    6

    Grouping query

    I have a table called TB which has PrevYear(Data type Currency), Debit(Data type Currency), Credit(Data type Currency), Description(Data type Text), Category(Data type Text). Category can be any of the following; revenue, expense, asset, liability etc.
    I want to create a report/query which groups the categories as follows;

    Revenue 2009(Debit/Credit) 2008(PrevYear)
    Credit Sales
    Cash Sales
    Subtotal
    Expenses
    Wages
    Travel
    Subtotal

    Profit/Loss

    Can anyone help with this?
    Michael

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    financial rollups in Access are not very complicated, but extremely tedious. Stack the various rows and columns in a temporary table and then report that table, with appropriate grouping. You'll end up with multiple append queries and a finally summing query. It's not work for a neophyte.

  3. #3
    Mphiri is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    6
    Thanks llkhoutx, I will appreciate your response.

  4. #4
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    Hi Michael. I'm an accountant. Maybe I can help. I understand you're trying to make a statement of comprehensive income out of your table. Just curious, did you structure your balance sheet and income statement to conform to the exact grouping you are after?

  5. #5
    Mphiri is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    6
    Quote Originally Posted by evander View Post
    Hi Michael. I'm an accountant. Maybe I can help. I understand you're trying to make a statement of comprehensive income out of your table. Just curious, did you structure your balance sheet and income statement to conform to the exact grouping you are after?
    Thanks Evander, I have structured my tbTrialBalance in such a way that I have among other fields, class and category. Class can be any of assets, revenue, expense, capital, liability etc(basically balance sheet structure), then category has interest earned, sales revenue, cost of sales, salaries and wages etc. I have decided to group by category for the notes to the financial statements, then for the statement of financial position and comprehensive income, I am grouping by class. Am I on the right track? Is this ok and is there anything else I need to do?

  6. #6
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    I assume you want both Class and Category to be both displayed in your trial balance. Or, do you want a separate presentation for class, and another one for category (hence, two different Group By queries)?

    If your goal is to present your trial balance both by class and category, you will need to structure your Chart of Accounts master list to contain the following fields:

    -AccountID
    -AccountName
    -Statement
    -Class
    -Category


    Try looking at a sample chart of accounts:
    http://rapidshare.com/files/39819940...lance.xls.html

    Then, create a query that groups your debits and credits in the following order (left to right, if you are using the query-by-example window):
    -Statement (Group by)
    -Class (Group by)
    -Category (Group by)
    -AccountID (Group by)
    -AccountName (Group by)
    -Debit (Sum)
    -Credit (Sum)


    If you wanted to produce a trial balance with accounting periods presented the way you showed in this post, I would rather give you a tutorial via TeamViewer instead, 'cause enumerating the steps will make this post quite long.

    Tell me when you have implemented the Chart of Accounts, and I will show you what to do next.

    Good luck.

  7. #7
    Mphiri is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    6
    Quote Originally Posted by evander View Post
    I assume you want both Class and Category to be both displayed in your trial balance. Or, do you want a separate presentation for class, and another one for category (hence, two different Group By queries)?

    If your goal is to present your trial balance both by class and category, you will need to structure your Chart of Accounts master list to contain the following fields:

    -AccountID
    -AccountName
    -Statement
    -Class
    -Category

    Try looking at a sample chart of accounts:
    http://rapidshare.com/files/39819940...lance.xls.html

    Then, create a query that groups your debits and credits in the following order (left to right, if you are using the query-by-example window):
    -Statement (Group by)
    -Class (Group by)
    -Category (Group by)
    -AccountID (Group by)
    -AccountName (Group by)
    -Debit (Sum)
    -Credit (Sum)

    If you wanted to produce a trial balance with accounting periods presented the way you showed in this post, I would rather give you a tutorial via TeamViewer instead, 'cause enumerating the steps will make this post quite long.

    Tell me when you have implemented the Chart of Accounts, and I will show you what to do next.

    Good luck.
    Evander, you are amazing.
    I have attached the table called TrialBalance as I would want it to be and the query aclled GroupedTrialBalance as you have instructed, both as text files.
    I hope I have followed your instructions.
    Thanks

  8. #8
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    Thanks for the compliment, Mphiri.
    Did you get the results you wanted?

    To create your grouped income statement, create a query that groups your AccountID's or AccountName's:

    (1) Statement (Group by)
    (2) Class (Group by)
    (3) Category (Group by)
    (4) Amount: Credit - Debit (Sum)


    This query casts credit-balance accounts in positive amounts, and debit-balance amounts in negative.

    ================================================== ====

    I'm inspecting your raw trial balance and the grouped one. I want you to give the following recommendations, if these are feasible on your part:

    (1) Account names (or account titles) need to be presented as they would appear in an external (or audited) financial statements, such as sales, cost of sales... If you want to create "departments" or subdivisions in the SALES account (such as Sales - Insecticides, Sales - Fertilizers), you can try to create a separate column identifier instead.

    Thus, when you're recording a journal entry to record Sales on account:

    Code:
    AccountID      AccountName               SubledgerID         Debit(Credit)
    1101             Accounts Receivable      Mr. Smith              100,000.00
    5001             Sales                           Insecticides           (50,000.00)
    5001             Sales                           Fertilizers              (50,000.00)
    (2) If your general ledger system uses a pure debit-credit recording method, you should use a single-column amount instead, with debits expressed as positive amounts, and credits expressed as negative. Creating separate columns for debits and credits results to unused cells.


    Good luck dude.

  9. #9
    Mphiri is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    6
    Quote Originally Posted by evander View Post
    Thanks for the compliment, Mphiri.
    Did you get the results you wanted?

    To create your grouped income statement, create a query that groups your AccountID's or AccountName's:

    (1) Statement (Group by)
    (2) Class (Group by)
    (3) Category (Group by)
    (4) Amount: Credit - Debit (Sum)


    This query casts credit-balance accounts in positive amounts, and debit-balance amounts in negative.

    ================================================== ====

    I'm inspecting your raw trial balance and the grouped one. I want you to give the following recommendations, if these are feasible on your part:

    (1) Account names (or account titles) need to be presented as they would appear in an external (or audited) financial statements, such as sales, cost of sales... If you want to create "departments" or subdivisions in the SALES account (such as Sales - Insecticides, Sales - Fertilizers), you can try to create a separate column identifier instead.

    Thus, when you're recording a journal entry to record Sales on account:

    Code:
    AccountID AccountName SubledgerID Debit(Credit)
    1101 Accounts Receivable Mr. Smith 100,000.00
    5001 Sales Insecticides (50,000.00)
    5001 Sales Fertilizers (50,000.00)
    (2) If your general ledger system uses a pure debit-credit recording method, you should use a single-column amount instead, with debits expressed as positive amounts, and credits expressed as negative. Creating separate columns for debits and credits results to unused cells.


    Good luck dude.
    Thanks again man, I seem to able to tell my right hand from my left one now in this regard, thanks to you. I am surely getting somewhere and if I get stuck again I hope I am welcome to call on you.
    Good day and God bless you mightily.

  10. #10
    evander is offline Competent Performer
    Windows 7 Access 2003
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    206
    No problem dude. Glad I can help. Keep on practicing.

  11. #11
    Mphiri is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    6
    Quote Originally Posted by evander View Post
    No problem dude. Glad I can help. Keep on practicing.
    I will pal, thanks.

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

Similar Threads

  1. Grouping strings
    By Fre in forum Access
    Replies: 16
    Last Post: 04-24-2010, 03:46 PM
  2. Need help grouping results.
    By cljac in forum Queries
    Replies: 9
    Last Post: 03-24-2010, 10:10 AM
  3. Grouping
    By dref in forum Reports
    Replies: 1
    Last Post: 01-16-2010, 08:30 AM
  4. Query Using Grouping is Cutting off Text
    By tigers in forum Queries
    Replies: 3
    Last Post: 06-22-2009, 11:11 AM
  5. Grouping from several comparisons
    By piflechien73 in forum Queries
    Replies: 3
    Last Post: 05-26-2009, 04:15 PM

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