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

    Question minus date wise sales a=n?

    sir,



    i have two table named "sales" and "salesrtn"

    in sales table fields are [saldate],[code],[model],[inv_no]autonumber,[price],[salqty].[salamount]
    in salesrtn table fields are [rtndate],[code].[model].[rtninv_no]autonumber'[rtnqty],[rtnamount]

    how i can design a query that datewise sales amount minus from sales return ( [salamount]-rtnamount] date wise? (how to manage sales date and sales return date in a query)

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    Place the Sales and Salesrtn Tables LEFT JOINED on Code field in a new Query.
    Place all the fields from Sales Table and place rtndate, rtnqty, and rtnamount from the Salesrtn table. The selected fields' list is given below:

    saldate, rtndate,[code],[model],[inv_no],[autonumber],[price],[salqty],[salamount], rtnqty, rtnamount, sale_qty:[salqty]-nz([rtnqty],0), sale_amount:[salamount]-Nz([rtnamount])

    All Sales recordS may not have matching sales return records. Once you LEFT JOIN the sales return table only the matching records will have values in the rtnqty and rtnamount columns. To fill such fields with zero values we must use the Nz() function to evaluate and change the field value to 0 so that the the calculation will not end up to Null values.

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

Similar Threads

  1. Date Add 26 weeks minus 1 day
    By ker9 in forum Queries
    Replies: 3
    Last Post: 07-26-2011, 01:20 PM
  2. Replies: 5
    Last Post: 06-30-2011, 02:24 AM
  3. minus particular Items (barcode) only...
    By alex_raju in forum Access
    Replies: 1
    Last Post: 06-28-2011, 11:11 AM
  4. Time minus one for hour.
    By brianb in forum Queries
    Replies: 2
    Last Post: 03-09-2011, 11:02 AM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 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