Re: Finding ANY Related Value



In article
<4dcff3a1-d13c-4c38-a740-7199a1264a3c@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, d-42
<db.porsche@xxxxxxxxx> wrote:

Then if you want how many there are you can count them on their
primary key using the Count function...

countRecords = Count(matchrelationship::primarykey)

or if you just want 'yes/no' there are matching records then define a
calc

hasMatching = not IsEmpty(matchrelationship::primarykey)

I'd go with CountRecords. I do several similar things in a large FM6
solution. First I'd set up a calc field in the related file

MatchCounter = Case (MatchField = WhatIWant, 1, "")

Then over in the primary file that primary that PatternCount is replaced by

If (Sum(Related::MatchCounter) > 0)
Do what a match calls for
else
Do what a non-match calls for
EndIf

Steve Brown
.