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.

Using set variable to add day on to a date

Featured Replies

I'm using Set Variable to set date boundaries for a find I'm performing but I'm having problems incrementing the date by this method.


Set Variable [$Week Start; Value:$Week End + 1]

Where $Week End is a date

If I don't include the "+1" Set Variable sets $Week Start equal to $Week End in the form of a date fine, but when I add the "+1" $Week Start is treated as a number not a date and also it also only increments the last digit i.e. the year instead of the day which is what I what.

I'm not sure what I'm doing wrong - is this the right way to be doing this?

Thanks in advance.

Graham

Are you sure the first variable, $Week End, is a date?

  • Author

Yes. The date which it is set to is passed into this script:


Set Variable[$Week end;RightValues(Get(ScriptParameter);1)]

I'm using Speak[$Week end] to listen to the format and it's describing it as "Twelve, Tweleve, Two thousand and six" not as "Twelve million, one hundred and twenty two thousand and seven" which is what happens when I try to set $week start to $week end +1.

Huh? I have no idea what you said there. However, I am quite sure the result of RightValues() is text, and with an extra carriage return to boot.

Yes. The date which it is set to is passed into this script:

That doesn't really mean a lot... You might have issues with your date formats here so i suggest that you pass the following as your script parameter: GetAsNumber(GetAsDate(YourDate))

Then for your variable use:

Set Variable[ $weekEnd ; GetAsDate(Get(ScriptParameter)) ]

Set Variable[ $weekStart ; $weekEnd + 1 ]

... might work.

  • Author

Thanks very much the GetAsDate function sorted out for me!!

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.