Jump to content

Calculate field using other related field


This topic is 5465 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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.

Link to comment
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 )

Link to comment
Share on other sites

This topic is 5465 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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