Results 1 to 5 of 5
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528

    Ask a process amounts


    Hello all
    I have a question about how to present material from the store POCKET

    SELECT Sum(tblGroups.Mykmea) AS SumOfMykmea, NamSelvir.NamSelver, NamSelvir.totalAmount, NamSelvir.datepurchase, Sum([totalAmount]-[Mykmea]) AS Expr1
    FROM NamSelvir RIGHT JOIN tblGroups ON NamSelvir.ID = tblGroups.TypeofSilverID
    GROUP BY NamSelvir.NamSelver, NamSelvir.totalAmount, NamSelvir.datepurchase;
    Click image for larger version. 

Name:	2.JPG 
Views:	9 
Size:	27.5 KB 
ID:	15061
    Why this error

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    What error?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    What's the relationship between the tables TBLGROUPS, NAMSELVIR?

    Is totalamount a calculated field?
    If NAMSELVIR is a query what's the SQL driving that query

    if this is something like a purchase order database it would seem that your query or table NAMSELVIR is the actual items the person or business purchased, but the 'totalamount' field is throwing me.

    You might try Sum([TotalAmount]) - Max([mykmea]) but without knowing the relationship of the two objects it's hard to tell

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Click image for larger version. 

Name:	3.JPG 
Views:	8 
Size:	55.7 KB 
ID:	15062Click image for larger version. 

Name:	4.JPG 
Views:	8 
Size:	24.0 KB 
ID:	15063

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you all
    I've brought me the solution rpeare
    I have found the solution
    It is
    SELECT Sum(tblGroups.Mykmea) AS SumOfMykmea, NamSelvir.NamSelver, NamSelvir.totalAmount, NamSelvir.datepurchase, ([TotalAmount])-Sum([mykmea]) AS Expr2
    FROM NamSelvir RIGHT JOIN tblGroups ON NamSelvir.ID = tblGroups.TypeofSilverID
    GROUP BY NamSelvir.NamSelver, NamSelvir.totalAmount, NamSelvir.datepurchase;

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

Similar Threads

  1. Aggregate Amounts and group ID together
    By shoro in forum Queries
    Replies: 1
    Last Post: 06-07-2013, 10:59 AM
  2. Help adding amounts from 3 tables
    By mrfixit1170 in forum Queries
    Replies: 10
    Last Post: 11-09-2011, 02:26 PM
  3. Quarterly Amounts
    By Brian62 in forum Queries
    Replies: 9
    Last Post: 10-16-2009, 02:18 PM
  4. Matching positive with negative amounts
    By cwert11 in forum Access
    Replies: 1
    Last Post: 09-29-2008, 12:26 AM
  5. show difference of amounts in a report
    By taniuca in forum Reports
    Replies: 0
    Last Post: 08-07-2008, 06:58 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