• Validation Query Problem (2000)

    Author
    Topic
    #420852

    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

    Viewing 0 reply threads
    Author
    Replies
    • #954244

      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.

    Viewing 0 reply threads
    Reply To: Validation Query Problem (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: