Results 1 to 2 of 2
  1. #1
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Best Practice for Getting Net Profit Sum

    Hi,
    Sorry, it has been awhile and I have lost what little knowledge I had gathered using Access (if you dont use it you lose it!)

    I have a simple table that includes

    Description, Date Sold, Net Profit (this is calculated field that takes price sold - commission percent, shipping, etc...)

    What I want is a display (textbox) on my main form that shows a running total for the current week of Net Profit
    and also a way to manual retrieve a total for specific date range

    Reason - I want to see the total at a glance all week....then run a report to cut a check (I am paying out Net Profit every Monday from previous SUN-SAT)

    Hope this is easy to understand.



    I need best practice and if possible actual code for getting the current week sum....I am having trouble using DatePart

    Thanks,
    Kevin

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    It may be easiest to display your results in a report. Report's have tools that are good for adding stuff up.

    It sounds like you will need a form with some unbound controls formatted as Date. With this, you can have the user enter some date parameters. From there, you can use the variables and the BETWEEN operator in a query.
    http://www.w3schools.com/sql/sql_between.asp
    You may also want to use the SUM function in your query. You want to be careful using WHERE clauses or HAVING clauses with aggregate functions. For instance, the SUM function will do an entire table dump and then apply the HAVING clause. I usually run a separate query with a WHERE clause and then apply the function to the filtered results.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-26-2015, 03:30 PM
  2. Access for non-profit survey data?
    By Safetymonkey in forum Database Design
    Replies: 1
    Last Post: 02-28-2015, 11:11 AM
  3. Moving Statistics below profit line on a report
    By Bill Singh in forum Access
    Replies: 1
    Last Post: 08-07-2014, 11:13 AM
  4. New to Access, Need to Design Database for Non-Profit
    By oatsybob in forum Database Design
    Replies: 1
    Last Post: 10-01-2012, 04:47 PM
  5. Replies: 5
    Last Post: 08-01-2012, 03:36 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