Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Relationship that shows records NOT in 2 other tables?

Featured Replies

Hi!

 

I have a problem... again... :ermm:

 

There are 4 tables: Calendar (CAL), DutyWish (DW), DutyNotWanted (DNW) and personnel (PER). If a person wishes to work on a certain day, the record is added to DW-table. And same if he definitely don't want to work to DNW.

 

I wanted to show ALL those names in CAL-table that have NO wishes either in DW or DNW -tables (i.e. no records in either tables). But how can this be done with relationships? The CAL-table have dates and they can connect to dates in DW and DNW -tables. PER -table have names.

 

Thanks in advance!

Seems to me like you do not both a DW and DNW table.  One table would do, a join between PER and the CAL dates, with a dw and dnw field in the join table.

  • Author

Hi!

 

Thanks for reply! I'm afraid also that my model will not work. Maybe I'll just combine those two tables (DW and DNW) to one and add one field to distinguish wheter it is DW or DNW wish. I wonder why I did 2 tables at all... Maybe there was some idea then.

 

But thanks!

I wanted to show ALL those names in CAL-table that have NO wishes either in DW or DNW -tables (i.e. no records in either tables). 

 

While Wim's suggestion for consolidating your two tables is very sound, I can't see how this solves your issue.

 

Assuming you have consolidated file Schedule as join table between Staff and Calendar, i.e.

 

Calendar --< Schedule >-- Staff

 

and that you are using IDs as relationship keys, rather than names, try creating a calculation field in Calendar as

Case ( 
  IsEmpty ( Schedule::id_staff ) ; 
  0 ; 
  List ( Schedule::id_staff ) 
)

and create a new relationship with

 

Calendar::cListOfScheduledStaff ≠ Staff_notScheduled::id

 

Now a portal into Staff_notScheduled would show you exactly these staff members.

  • Author

Thank you, Eos!

 

I tried your solution and it worked - once. I made a test bed for this and in there it did work. But when I tried to implement it to original file it doesn't. I think that I try to make relationships among wrong files.

So, to be sure, could you explain the correlations with names. I assume:

CAL --- Calendar

DutyWish (DW+DNW) --- Schedule

Personnel --- Staff

 

What is "Staff_notScheduled" you mentioned in that relationship?

  • Author

And here is my present relationship model. There is (for testing) both correlation and non-correlation relationships. Neither of these work. (I hate to be so stupid... :logik: )

 

Screenshot%202015-02-24%2013.37.53.jpg

  • Author

See if the attached file makes the idea clearer.

Ok... That makes it a bit clearer. But what is the difference in Schedule between id and id-staff -fields?

what is the difference in Schedule between id and id-staff -fields?

 

One is the table's primary key (every table holding business data should have one), the other one is a foreign key – which you can tell by the fact that one field is defined as an auto-enter serial, and the other one isn't.

  • Author

Eos,

 

Thank you! I appreciate your help! Try to figure out that tomorrow. Propably it is best to build the whole system from a scratch again.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.