Compare Columns

I have two dbs:Db1: In View Product, list of products are displayed. There are 4 columns (Col#1, Col#2, Col#3, Col#4) for each product.

Db2: In View Product, there are 6 (or more) columns (Col#1, Col#2, Col#3, Col#4, #Col5, #Col6) (or similar to Db1).

When the user clicks on one of the rows in the view, A form is opened shows with all details (Col#1, …, Col#4) are displayed.

How can I compare to see if Col#1 of one db matches Col#1 of another?

I am sure that there are some experts on here who can help me out with this simple problem.

Any help would be appreciated!

Thank you!

Mary White.

Subject: RE: Compare Columns

Your question is vague. Please consider the following:

Where do you want to display this information? On the form when the document is opened, I assume.

When you open a document, you’re not looking at columns, with all the values of the whole database; you’re looking at fields – one value from each column, with perhaps additional fields not displayed in the view. What do you mean about comparing column 1 (actually not a column, but some field in the current document) to column 1 in another database? Compare what about them? Do you want to compare one field value to a whole column in a view in database 2, and display whether there’s any value in that column that’s not the same as the value in this document? Or do you want to to display whether there’s any value that is the same? Or count how many times this value appears in the column? Or do you want to find a corresponding document to the current document, and display whether its fields are different from the fields in the current document? All of these and other things are possible but you must specify exactly what you want.

Assuming you want to find a corresponding document to compare this one to. What establishes the relationship between that document and this one? Is there a “key” field or fields that have the same value in the two documents? If so, which field? Is it an editable field? If it is, then what happens if someone changes the value of the field in one of the documents, but not the other? Does a correspondence still exist between the documents, and if so, how do you propose to match them with each other after the edit?

Can there be multiple documents in database A that match a single document in database B, or vice versa? Can there be no matching document? What do you want to do if there are no matches or multiple matches? If there must be at least one match or are not supposed to be multiple matches, are you doing something to make that happen?

The commands @DbColumn or @DbLookup, or both, or the LotusScript method GetDocumentByKey, GetAllDocumentsByKey, or GetAllEntriesByKey, may be helpful to you, depending what you’re trying to do. Read about these and look at the examples, and if you still have a question, please provide a more exact description of your problem.