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

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
Sign in to follow this  

×

Important Information

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