Access 2K3 Question

Discussion in 'Software' started by BigR, Jun 25, 2005.

  1. BigR

    BigR Private E-2

    Hello,

    I am working on a project that is using access database.

    i want to group results that i get in my query by 2 fields, date and Description.

    there are 2 numeric fields in each record, that when grouped, should give a total for each record that has the same date and description. however, when we try to get it to work, we can get the date and descriptions to group properly but the totals in the numeric fields dont add up correctly.

    any help would be greatly appriciated.

    p.s. if you need sample data to see what i mean, let me know and i will see what i can do.

    thanks
     
  2. rpgfan3233

    rpgfan3233 Private E-2

    Sample data? Sure, why not! :D
     
  3. BigR

    BigR Private E-2

    ok, this isnt actual data, but it will get the point across.

    DATE | DESCRIPTION | AMOUNT A | AMOUNT B | MISC
    ===================================================
    21/05/05 Payment 1400 1242
    14/03/04 Payment 900 1245
    21/05/05 Payment 200 3541
    21/05/05 Withdraw 500 1544
    13/06/05 Withdraw 1542 1577
    14/03/04 Payment 1244 1457



    Now what we want is to have all the payments on a certian day to be
    grouped.

    DATE | DESCRIPTION | AMOUNT A | AMOUNT B | MISC
    ===================================================
    21/05/05 Payment 1600 4783
    14/03/04 Payment 2144 2702
    21/05/05 Withdraw 500 1544
    13/06/05 Withdraw 1542 1577



    we can get them to group right, but they dont add up correctly

    hope this helps, or i probally just confused everyone more lol
     
  4. Kodo

    Kodo SNATCHSQUATCH

    Table1= Your Table Name
    PayA= Your Amount A field
    PayB=Your amount B field
    pDate=Payment Date field

    SELECT Table1.pDate, Sum(Table1.PayA) AS SumOfPayA, Sum(Table1.Payb) AS SumOfPayb
    FROM Table1
    GROUP BY Table1.pDate;

    Have fun
     
  5. BigR

    BigR Private E-2

    Thanks, ill let you know how it goes
     
  6. BigR

    BigR Private E-2

    that worked out well, now i have another question.

    We are generating reports, based on 5 queries. The customer will input data to gather the info they want. now i was wondering if there is a way for us to take the report that is generated and save it as a word document so the customer can go back and review past reports.

    can this be done in code or in macros??

    thanks
     
  7. Kodo

    Kodo SNATCHSQUATCH

    in code, you would follow the parameters used for
    DOCMD.OUTPUTTO command on a click event of a button.

    I forget the exact syntax but you should be able to find it easy in the tool tip pop up. I think the closest thing to word it will export to is RTF..
     
  8. BigR

    BigR Private E-2

    ok, got another question.

    is there a way to store the results of a query in a variable. I am opening up reports that are saved on teh computer in word through access, and i need to get the path from a table.

    thanks
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds