# searching related records

**URL:** <https://forum.servoy.com/t/searching-related-records/4042>\
**Category:** Classic Servoy\
**Created:** [April 14, 2005, 12:53pm UTC](https://forum.servoy.com/t/searching-related-records/4042 "2005-04-14T12:53:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gevans](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@gevans](https://forum.servoy.com/u/gevans)\
**Post date:** [April 14, 2005, 12:53pm UTC](https://forum.servoy.com/t/searching-related-records/4042/1 "2005-04-14T12:53:59Z")

</div>

I have two tables: locality and synonym. Each locality, identified by loc\_id, has a name. Some of the localities have a number of synonyms in the synonym table, using loc\_id as a foreign key, but many of the localities do not have any related records in the synonym table.

When searching for a locality name, I need to search both the locality table and related records in the synonym table.

Using the menus, the process is:

- find
- enter ‘Test’ in field locality\_name
- new record
- enter ‘Test’ in field synonym (on related table)
- search

In 2.2 beta 2 this search included all records in the locality table, and also all related records in the sysnonym table. However in beta 3 and 4 it only includes those records in the locality table which have related records in the synonym table, and the related records.

Has something been changed or is this a bug?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [April 15, 2005, 3:23pm UTC](https://forum.servoy.com/t/searching-related-records/4042/2 "2005-04-15T15:23:48Z")

</div>

this can’t be changed because it always worked this way  
If you are searching over related records (so a join) then that join must also be valid..

If you want something else then you must ust outer joins and do the query youre self (loadRecords with sql)

---

<div class="post-metadata">

**Author:** ![gevans](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@gevans](https://forum.servoy.com/u/gevans)\
**Post date:** [April 22, 2005, 1:52pm UTC](https://forum.servoy.com/t/searching-related-records/4042/3 "2005-04-22T13:52:45Z")

</div>

Thanks for the explanation. Strangely, it did seem to work this way before - maybe _that_ was the bug! Anyway, now I know not to expect it to work that way, and have written the search using SQL. Thanks again.
