Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

two match fields


rocktap

This topic is 7855 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Is it possible to create a relationship that requires two fields to match (in my case 'amount' and 'date', so that a third field's data can be looked up. I tried a calculation (if, test, result 1, result2), where the test was to match amount and date in each respective DB but no result would come up.

Link to comment
Share on other sites

Hi rocktap,

It sure is. The way to do it is to create a calculation within each file which concatenates the respective fields. Ie with a formula along the lines of:

AmountField & "-" & DateField

...then create a new relationship which matches the calculating fields to each other.

Then the match - via the new relationship - will only occur between records where both the amount and date are the same.

Link to comment
Share on other sites

Except it ain't quite that simple.

If you are creating related records in a portal, you need a calc field in the main file, and a key field in the related file that will enter the result of the calculation (that field should be a text or number field, or whatever, depending on what the calc field in the main file returns -- in your case, I recommend a text field).

If you want to split the data into two separate fields in the related file, you'll need two calc fields, each returning the related field in the main file (which means you have to set up an identical relationship from the related file to the main file).

BTW, I recommend that your original calc field read:

NumToText(AmountField) & " - " & DateToText(DateField)

Link to comment
Share on other sites

Sorry Dan, but if you read the original post, it *is* that simple.

Rocktap specifically says what the relationship is for: "...so that a third field's data can be looked up...".

The solution you're suggesting is three times as versatile - and three times as complex - as what Rocktap has indicated is required. wink.gif

Link to comment
Share on other sites

Yes, well, that's what happens when the board automatically jumps past stuff I've already read -- even if I've forgotten just exactly what it was I did read (like, maybe a couple of days ago).

I've complained about this "feature", but seemed to be overruled by several others who like it. I now consider myself vindicated on that point at least.

Link to comment
Share on other sites

This topic is 7855 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.