Results 1 to 5 of 5
  1. #1
    Lilsug is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    3

    Sum Queries

    OK, I'm creating a simple set of financial tables that will calculate Outstanding AR in different ways and perform some other things. I have a table that is calculating the Outstanding AR right now on a departmental basis for each month. Notice the 1st three Characters in Cust_code identify the customer, and the rest identifies the department. I added a field called Cust_Abr to the end that is just those first 3 characters. This is the table named 2010 Outstanding Revenue.

    2010 Outstanding Revenue
    Cust_Code
    January February
    BEEJ10301 $50.00 $50.00
    BEEJ20101 $50.00 $50.00
    BROCA
    $50.00 $50.00
    BROJ10101 $50.00 $50.00
    BROJ20201 $50.00 $50.00


    BROJ30301
    $50.00 $50.00
    BROJ40401
    $50.00 $50.00

    There is another table Called Customer Abbreviations that has the first 3 characters (BEE) and the actual account name.

    Customer Abreviations
    CUST_ABR
    CUSTOMER_Name
    BEE
    BEE Enterprises
    BRO BROWN TECH
    CAL CALDWELL CONSTR
    CAM CAMPBELL SOUP
    CAS CAST PRODUCT


    I am building a query that will sum the BEE figures into one January and Feb and March etc... As well as BRO and every other Customer. This way I have a detailed Outstanding AR by month for each department, and one for the customer as a whole. I am currently trying to query this into a table, but can't seem to get it.

    I want the result table to look like this:

    2010 OAR BY ACCOUNT
    Customer January February
    BEE Enterprises $100.00 $100.00
    BROWN TECH $250.00 $250.00

    Please Help! I've tried dsum, sum and I can't seem to get it to matchup on the customer codes properly.

    Thanks

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    select b.CUSTOMER_Name as CUSTOMER, sum(a.january) as january, sum(a.february) as february
    from [2010 Outstanding Revenue] as a inner join [Customer Abreviations] as b on b.CUST_ABR =left(a.cust_code,3) group by b.CUSTOMER_Name

  3. #3
    Lilsug is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    3
    Thanks for the reply!

    This query is asking me for a Cust_Code parameter and then populating every Customer with that code's OAR. Not really sure what to do.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    check the field name in [2010 Outstanding Revenue], if it's not cust_code, modify it.

  5. #5
    Lilsug is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    3
    Works!

    Thanks alot!

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

Similar Threads

  1. Need Help with Queries
    By mulefeathers in forum Queries
    Replies: 2
    Last Post: 05-24-2010, 11:37 AM
  2. Queries
    By MeganDoak in forum Queries
    Replies: 3
    Last Post: 04-22-2010, 12:13 AM
  3. how i can run a sum queries
    By ahmed-aljawad in forum Queries
    Replies: 3
    Last Post: 04-17-2010, 11:06 AM
  4. Replies: 5
    Last Post: 02-08-2010, 06:12 PM
  5. need help with queries
    By gromit95 in forum Queries
    Replies: 1
    Last Post: 02-06-2009, 06:50 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