Results 1 to 4 of 4
  1. #1
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83

    Appending Missing Dates

    I have two tables which are being linked into a database.

    The first table is called "Sell Yes or No", where it lets me know if I Sell the item (Y) or not (N).

    Next is a table called "Date Data". This table shows the item, DateEnter and the amount.

    So If I sell a item (Y), and there is a date for that item in the date data, I want all the item that I sell that is a "Y" to have that same date and the amount to be 0 if it does not have an amount to it.

    So I would like to see

    Item Sell dateenter amount
    shoes y 1/1/2012 2
    Shirt y 1/1/2012 0
    Jeans y 1/1/2012 0
    shoes y 2/1/2012 0
    shirt y 2/1/2012 2
    jeans y 2/1/2012 4

    Attached Files Attached Files

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    It is not clear exactly what you need.
    Could you describe in different words, please - so that it is easier to understand?
    Give us more details of what you want.

  3. #3
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83
    I would like for all Item that I Sell to all have the Same Amount of DateEnter. If the amount is not in the Date Data then the amount should be set to 0.

    So for the three items I sell, (Shoes, Shirt and Jeans) they should have dates 1/1/2012 and 2/1/2012.

    Shoes should have the amount of 2 from the Date Data with the date 1/1/2012. But Shirt and Jeans amount should be 0for 1/1/2012 since there was nothing in the Date Data.

    So for shoes amount should be 0for 2/2/2012 since there was nothing in he Date Data. Shirt and Jeans amount should be 2 and 4 respectively for 2/1/2012 from the Date Data.

    Please let me know if this is still unclear.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Try:

    1. Query1
    SELECT [Date Data].DateEnter, [Sell Yes or No].Item, [Sell Yes or No].Sell
    FROM [Date Data], [Sell Yes or No]
    GROUP BY [Date Data].DateEnter, [Sell Yes or No].Item, [Sell Yes or No].Sell
    HAVING ((([Sell Yes or No].Sell)="y"));

    2. Query2
    SELECT Query1.*, Nz([Amount],0) AS Amt
    FROM [Date Data] RIGHT JOIN Query1 ON ([Date Data].DateEnter = Query1.DateEnter) AND ([Date Data].Item = Query1.Item);
    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. Report missing ship dates and other info...
    By adam1986 in forum Access
    Replies: 8
    Last Post: 08-25-2011, 01:56 PM
  2. Key violation when appending records
    By slaterino in forum Programming
    Replies: 10
    Last Post: 08-26-2010, 08:25 AM
  3. Newbie needs help appending table
    By hara in forum Queries
    Replies: 6
    Last Post: 06-30-2010, 05:42 PM
  4. Need appending help?
    By asilva in forum Access
    Replies: 6
    Last Post: 02-17-2010, 03:53 PM
  5. Appending to a Combo Box
    By cotri in forum Forms
    Replies: 5
    Last Post: 01-28-2010, 02: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