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.

Automatically Set Which Period a Date Falls In

Featured Replies

Hi All, bit of a novice here.

I have a table that defines the start and end dates for football seasons. In my table Matches, I want my 'Season_ID' field to automatically show the 'SeasonDescription' for which ever season it is when I insert the 'MatchDate'. Can anyone advise me how to do this? Don't imagine it can be that difficult but I cant find anything using google.

Table: Seasons

  • Season_ID
  • SeasonDescription [iE: SEASON 2011/12]
  • SeasonStartDate [iE: 01/JUN/2011]
  • SeasonEndDate [iE: 30/MAY/2012]

Table: Matches

  • Match_ID
  • MatchDate
  • Season_ID

You can define a relationship as:

Matches::MatchDate ≥ Seasons::SeasonStartDate

AND

Matches::MatchDate ≤ Seasons::SeasonEndDate

then place the field Seasons::SeasonDescription on the layout of Matches.

If you prefer to associate a match with a season through the date, then the field Matches::SeasonID is redundant.

  • Author

Thank you, make perfect sense.

However having created the field, I'm not 100% sure on how I'd populate it. Would I use a value list or is there something else I can set to do it for me?

It only makes to populate it if you are going to use it - i.e. if the relationship between the tables will be:

Matches::SeasonID = Seasons::SeasonID

  • Author

It only makes to populate it if you are going to use it - i.e. if the relationship between the tables will be:

Matches::SeasonID = Seasons::SeasonID

Sorry - I think my poor use of the proper terminology has made my last post unclear.

I have created the date relationship as you described. And put the SeasonDescription on the Matches layout. But its showing up empty and I cant work out how to populate it?

Apologies if I seem a little off it. Appreciate the help.

You are not supposed to populate it (in the Matches table). It should be showing data from the related record in Seasons. If it doesn't, then either the relationship doesn't work or there is no data in the field (in the Seasons table).

  • Author

You are not supposed to populate it (in the Matches table). It should be showing data from the related record in Seasons. If it doesn't, then either the relationship doesn't work or there is no data in the field (in the Seasons table).

Oops. I hadn't set the dates correctly - thank you.

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.