Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validation Query Problem (2000)

    I'm trying to create a simple query to validate a range of records after they have been imported into my database. Also, I want to do this validation after the import, rather than rejecting the records upfront during the import; it's just easier for someone to correct the few records when this happens than reimport the records with correct information later.

    First a little background: I am using two tables - 1.) DATAtbl, containing all invoice information for each customer, and 2.) CUSTtbl, containing all customer information. CUST_ID from the CUSTtbl is looked up in the DATAtbl CUST_ID field, i.e. CUSTtbl records are one to the many DATAtbl records. CUST_ID in CUSTtbl is a prime key; it is not a prime key in DATAtbl.

    The basic validation is to return any records from the specified range when the CUST_ID in the DATAtbl doesn't match a CUST_ID record in the CUSTtbl, i.e. a CUST_ID as imported either doesn't exist or was input incorrectly. The criteria is between a date range keyed off of the INV_DATE field. The fields to return are: 1.) INV_DATE and 2.) DATAtbl.CUST_ID

    Any suggestions?

    Thanks,

    Scott

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Validation Query Problem (2000)

    Create a query based on DATAtbl and on CUSTtbl.
    Join them on CUST_ID.
    Double click the join line and select the option to return ALL records from DATAtbl.
    Add INV_DATE, DATAtbl.CUST_ID and CUSTtbl.CUST_ID to the query grid.
    Add the date criteria for INV_DATE.
    Clear the Show check box for CUSTtbl.CUST_ID, and set the criteria for this field to Is Null.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation Query Problem (2000)

    Worked great. Thanks Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •