Results 1 to 6 of 6
  1. #1
    alex_raju is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    56

    making sales return(amount minus) on particular sales date...

    dear sir,



    first of all i would like to say many many thanks to accessforum (mr.pillai & all)coz, i have gain many useful tips from accessforums.net.

    -----------------------------

    how to compare and minus sales return from sales date wise ( like, on 23-06-2011 sales is 500$ at the same date 20$ was sales return )


    date sales salesreturn netsales

    1-1-2011 500$ 20$ 480$
    2-1-2011 1000$ 0$ 1000$
    3-1-2011 800$ 50$ 750$


    like

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Looks like this would be a simple expression in query to subtract one field from another.
    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
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    .... and the netsales would be a calculated field subtracting sales from salesreturn.

    SELECT date, sales, salesreturn, sum([sales]-[salesreturn]) as netsales From [YourTableName]

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Sum is an aggregate function. Using it requires a Totals query with GROUP BY clause. Exclude the Sum and simply: [sales]-[salesreturn] As NetSale. Then in a report use Grouping & Sorting with aggregate calcs to further manipulate the data.
    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
    alex_raju is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    56
    Quote Originally Posted by khalid View Post
    .... and the netsales would be a calculated field subtracting sales from salesreturn.

    SELECT date, sales, salesreturn, sum([sales]-[salesreturn]) as netsales From [YourTableName]

    there are four table :

    main_sales -pk
    sales_details-fk

    main_return -pk
    return_details_fk

    when i make like you say, non return days also happening duplicate

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Definitely complicates the situation and not at all like the data structure you presented in first post. Need to manipulate the data to get to that structure. Will have to do a Totals query for the sales and a Totals query for the returns and then join these on the value used for grouping, which from your sample looks like date.
    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.

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

Similar Threads

  1. Daily Sales Report
    By bayswatergirl in forum Reports
    Replies: 1
    Last Post: 06-02-2011, 12:27 PM
  2. How to Benchmark The Best Month Sales
    By jasonman in forum Queries
    Replies: 4
    Last Post: 11-13-2010, 12:30 PM
  3. Replies: 1
    Last Post: 04-15-2010, 02:07 AM
  4. Point of Sales Application
    By chico_yallin in forum Access
    Replies: 1
    Last Post: 06-23-2007, 05:30 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