Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to link based on one field OR the other available?

Status
Not open for further replies.

CherrySoda

Technical User
Jun 5, 2008
16
US
Version 10.

I would like to setup a report that links two fields each from the same table in each database (interbase and excel). I want the second ID field linked in the event that there is missing or incorrect data from the first id field, and the ID numbers don't match.

For example:

InterbaseTable1.ID1 ----> Excel.ID1
*if not matching for the above, then use this:
InterbaseTable1.ID2 ----> Excel.ID2

What is the best way to approach this issue?
 
Do it in the slect statement

(If InterbaseTable1.ID1 <> Excel.ID1
then InterbaseTable1.ID2 =Excel.ID2
else InterbaseTable1.ID1 = Excel.ID1)

Wrap in brackets as above so that you can add other clauses to select if required.

Ian


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top