Jump to content
Sign in to follow this  
dpcurrier

Calculate field using other related field

Recommended Posts

I apologize if my subject line does not clearly explain what I am trying to do.

2 tables: teams and games

teams

------------

*team_id, team_name

T0001, TEAM 1

T0002, TEAM 2

games

------------

*home_tm_id, home_tm_name, *away_tm_id, away_tm_name

T0001, , T0002,

I am trying to calculate each by the specific team_id being entered in the home and away field ids.

So when you select a team as a home team (which is linked to teams by team_id) it will know to populate the home_tm_name with the team_name that corresponds to the team_id used in home_team_id.

As I am pulling in two team_ids I have been unsuccessful and calculating these fields to recognize each one separately.

Share this post


Link to post
Share on other sites

I am not sure you will even want the home_tm_name and away_tm_name fields. If you need it for some type of historical ( for exmaple, if you plan on changing the team name in the team table and want to know what it was at that point in time when the game happened ) then you can use lookups.

If not, then you can just put the related team name on the game layout.

You should have two relationships.

game::home_tm_id >-- TeamID ( let's call this table occurrence HomeTeam )

game::away_tm_id >-- TeamID let's call this table occurrence AwayTeam )

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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