Results 1 to 7 of 7
  1. #1
    Flanders is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    7

    Find Missing Records

    Hello. Thanks in advance for the help!



    I have a table containing Three Columns

    Price.PN
    Price.Date
    Price.Price

    For a given future Date, some PN’s (Part Numbers) have a price, and some do not. I want to extract all of the PN’s that don’t have Prices on a future Date.

    I’ve tried creating a table with all future Dates, and trying to do some outerjoins to it but I haven’t had any success.

    Any help would be appreciated. Sample data are attached.


    Thanks,

    Jeremy

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So you want to
    SELECT PN
    FROM Price
    WHERE IsNull([Price ]) AND Date = #[YourDate]#
    Correct?
    BTW, having a field in a table with the same name as the table is a lousy idea and Date is a reserved word.

  3. #3
    Flanders is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    7
    Thanks. Actually I found another way around it, but I'll try your way, too. My way is pretty clunky. I definitely see your point about the naming conventions I used. I'm confusing myself to no end. But hey, this is my first ever Database, and I made sure to make plenty of mistakes so I can learn from them!

    I ended up Creating a table with all of the Dates [Date Table], and then I created a compound field with Date and Price, and then did a Where not exits command to pull the info

    Query1: DatePart
    SELECT [Date Table].Date, [Date Table].[Date] & [Parts].[PN] AS DT_Tag, *
    FROM [Date Table], Parts;

    Query2atePrice
    SELECT Price.Date, Price.PN, Price.Price, [Price].[Date] & [Price].[PN] AS PT_Tag, *
    FROM Price;


    Query3:Missing Prices
    SELECT Date, PN
    FROM DatePart
    WHERE Not Exists (select * from DatePrice where Dateprice.PT_Tag = DatePart.DT_Tag);



    It's the long way around, but it works :-)

    Thanks for the help!

  4. #4
    Flanders is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    7
    I think the method you proposed assumes that there are records with no entries for price. My problem is that there isn't even a record entry. The record in the Price Table doesn't exist unless there IS a price.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It sounds like you solved your own problem. That's great!

  6. #6
    Flanders is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2009
    Posts
    7
    Yes, but I have only about 85% the hair I had before

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    85% is much better than none!

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

Similar Threads

  1. IMPORT-ALL-OBJECTS is missing Tool
    By pacala_ba in forum Import/Export Data
    Replies: 0
    Last Post: 03-25-2009, 10:13 AM
  2. Missing Operator error
    By data123 in forum Forms
    Replies: 1
    Last Post: 03-15-2009, 04:34 PM
  3. 2007 runtime missing
    By wayfarer in forum Access
    Replies: 0
    Last Post: 07-21-2008, 02:26 AM
  4. Microsoft Access 2003-Missing Records??
    By kristenlee in forum Access
    Replies: 1
    Last Post: 04-04-2008, 06:43 PM
  5. Replies: 1
    Last Post: 06-09-2006, 03:55 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