Skip 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.

Date Calculation Dilemma`

Featured Replies

Hi all,

Just a newb question here - I need to take a date and calculate 10 weeks on from it automatically. If the day turns out to be a weekend it should automatically round off to the next Monday.

Any ideas how I need to do this? Some of the solutions on here are a little intricate for what I need for this!

Thanks in advance for your kind assistance.

Rgds

Assuming 7 days a week which we will because you haven't stated there aren't, something like the following should work:

Get(CurrentDate) + 70 + Case( DayName(Get(CurrentDate)) = "Saturday" ; 2 ; DayName(Get(CurrentDate)) = "Sunday" ; 1 )

... or if you want to use something other than the current date use the below and replace get(currentDate) with your date field / value:

Let( x = Get(CurrentDate) ;

x + 70 + Case( DayName(x) = "Saturday" ; 2 ; DayName(x) = "Sunday" ; 1 )

)

I wouldn't use DayName() for this, because it will break if the language is not English:

YourDate + Position ( "17" ; DayOfWeek ( YourDate ) ; 1 ; 1 ) + 70

  • Author

That is fabulous! Thanks for the assists there. Interesting point about the language, but as luck would have it I am using English in this db.

Many thanks!

as luck would have it I am using English in this db.

It's a matter of good practice. Hopefully, one day your solution will be a world-wide success - and THEN you'll wonder why it doesn't work for some.

I wouldn't use DayName() for this, because it will break if the language is not English:

Fair call.

  • 1 month later...
  • Author

Hi there

I have finally got around to giving this a go and it just isn't working for me. I get a load of errors stating that either the GET function will not work or else there are missing parameters. I followed the instructions so am a bit baffled.

I would like this to be a script rather than a calculation as I want more control over when it is calculated.

Thanks for your help.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.