Results 1 to 12 of 12
  1. #1
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31

    Sum by Won Project in by each month of the year

    Hello i have a report that with the fields:
    Proposal Number Client Name Proposal Fee Status(won, lost, pending)
    Code:
    =Format$([Dated],"mmmm yyyy",0,0)

    The report shows the Sum of the Fees
    Code:
    =Sum([Proposal_Fee])
    here is where the problem begins
    I want it to show the sum of the project won by each month, how ever i have no idea on how to make it work, since the coding i am using shows the sum of all the project in the form, of all years and month, here is the code
    Code:
    =DSum("[Proposal_Fee]","QryProposalInOrder","[Statu] Like 'Won*'")
    is Statu because this fields shows the combination of the fields, the Status, and the Project Number of the Proposal


    also at the end of the report i want the sum of the Yearly Proposals won(my guess is that having the monthly and yearly, the yearly would be the easiest to do

    i need some help pls,



    Thanks in advaned

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Create a month/year field in query with expression: Format$([Dated],"mm yyyy",0,0). Use this field to group and sort records in the report. Do Sum calc in textbox of group header/footer.
    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
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31
    i see,
    but how will i sum the proposals won within that month(while showing all the proposals)

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Use report grouping and sorting. Set up a group on the month/year constructed field. Textbox in that group header/footer with expression in ControlSource: Sum([Proposal_Fee]).

    Put fields for proposals info in the Detail section.

    Does the table include records for proposals not won?
    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.

  5. #5
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31
    ye sir, the table has all of them(Won Lost, Pending, and Submitted), as well as the report should have all of them.

    i am using a query to set up the report, i thin that you are assumign that i only have won Proposals,however i need to have them all together, 1,- show the sum of all of them by month and year( Which is something i hve)
    I Do not have the coding to sum only won Proposals by month and year.

    this is the code that i am using in the TEXT BOx,

    =DSum("[Proposal_Fee]","QryProposalInOrder","[Statu] Like 'Won*'")
    The code above add ALL the porjcet in the report, not the won project by month

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    I don't think you want or need to use DSum. DSum is a domain aggregate function (along with DAvg, DCount, etc) and is pulling data from the table, not the report's recordsource. Try this in textboxes in month/year group header or footer and form header or footer:

    =Sum(IIf([Statu] Like "Won*", [Proposal_Fee],0))
    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.

  7. #7
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31
    ey Thank you so much, and sorry for the late reply, i had was at school and doing hmwk all day )))

    U saved my life!

  8. #8
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31
    quick question thought:
    i have a query field that combines the Status and The Project Number
    Ex. Won 009-112

    I want it to be like this
    Won
    009-112
    I tried pressing CTR+ Enter (because that make a new page in Micrsft. Word)

    I works fine until i close and open the access file, how can i make this to be permanently.is there an expression i can put in the field name
    Statu: [Status] & "(here is when i press 'ctrl+Enter')" & [Project Number]
    Thanks!!

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Try:
    Statu: [Status] & Chr(13) & [Project Number]
    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.

  10. #10
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31
    nop, it only makes a square between status and and Project Number

    Thanks for the fast reply bro!

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Sorry, been a while since I used that.

    Statu: [Status] & Chr(13) & Chr(10) & [Project Number]
    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.

  12. #12
    011billyw is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    31
    Thank you so much bro again
    You saved me alot of time
    thanks

    And this Threat is SOLVED

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

Similar Threads

  1. Sorting by month and day - without year
    By TracyBell in forum Access
    Replies: 3
    Last Post: 11-17-2011, 10:29 AM
  2. show records in this month last year?
    By geoffcox in forum Queries
    Replies: 4
    Last Post: 06-11-2011, 07:12 AM
  3. Replies: 1
    Last Post: 04-12-2011, 06:45 PM
  4. default month and year
    By beefyalby in forum Forms
    Replies: 3
    Last Post: 12-05-2010, 11:40 PM
  5. by year by month
    By nkuebelbeck in forum Reports
    Replies: 21
    Last Post: 03-24-2010, 01:53 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