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.

Auto enter start date based on end date in a previous record

Featured Replies

  • Newbies

Hi there,

I'm fairly new to Filemaker, but I'm pretty sure there is a solution to what I'd like to achieve. I'm trying to keep a log of hotel rates. The rates are valid for date periods and each date period follows consecutively. To speed up data entry and eliminate errors I feel there is really only a need to enter the end date for each rate period and the start date should be calculated from the previous end date e.g below:

Start Date End Date Rate 01/01/2012 15/01/2012 500 16/01/2012 31/01/2012 400 01/02/2012 20/03/2012 450

The initial start date would need to be entered, but after that the start date in the next record could be calculated from the previous end date i.e. previous end date + 1. I think there must be a way to achieve this with a custom function, but I've scoured the internet for a solution and can't seem to find one.

Any ideas?

Make StartDate a date field with an autoentered calculation:

Let(

prevEndDate=GetNthRecord ( EndDate ; Get ( RecordNumber ) -1);

if(prevEndDate≠"";prevEndDate+1;"")

)

  • Author
  • Newbies

Thanks, this works brilliantly!

  • Author
  • Newbies

I've just realised that whilst this works perfectly when entering data, there is a flaw if you need to change the end dates. If you change the end dates, the start dates aren't updated automatically when using an auto entered calculation. If I swap the start date to a calculation field this works except for the very first record where the start date can't be calculated. Ideally I'd have an auto enter calculation just for the first record and then the calculated field for the remaining records. I don't think this is possible. Other than having 2 fields, which I don't feel is an elegant solution. Is there a better solution?

Create an account or sign in to comment

Important Information

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

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.