PDA

View Full Version : HELP WITH A QUERY


ABC123

MIKKI BREAUX
11-20-2002, 07:43 AM
I am trying to see if values in a table exist in another table so that I will not duplicate them. I have an index set up in both tables called TRIM as trim(lastname)+add1. I am trying to run a query, but can quite figure it out. I know I will need to use exists, or key_exists. Any help???

Melvin Davidson
11-21-2002, 04:35 AM
Mikki,

Two things.

1. As a general rule, it's not good to name fields the same
as functions. I would suggest TRIM_NAME or NAME_TRIM
instead.

2. You don't need to do a query. You can easily make a
field rule to prevent duplicates.

In field rules for that db, click the Validations tab.
Then in Cross file validation, select the Advance option

For Field, select and then enter
trim(lastname)+add1

For Test, select 'Must not exist in'

For Database selrct the database you want to check

For Lookup, select and then enter
trim(lastname)+add1

Leave the condition blank

hope that helps,
Melvin