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.

Featured Replies

I am trying to paste a calculated result into a a date field

The calculation is the following

1/next month/current year..endday/next month/current year

in other words I need to find all records from the following month

I hope that makes sense.

thanks

Try like this:

Insert Calc Result[Date_Field,

DateToText(Date(Month(today),1,Year(Today))&".."&

DateToText(Date(Month(today)+1,1,Year(Today))-1)

I prefer using Enter Find Mode [ ] and Set Field [ ] here. You don't have to have the field on layout as Insert Calculated Result [ ] requires and vs. 7 now allows calcs on date fields in finds. Today isn't in vs. 7:

Date(Month(Get(CurrentDate)) + 1; 1; Year(Get(CurrentDate)))

& "..." &

Date(Month(Get(CurrentDate)) + 2; 0; Year(Get(CurrentDate)))

Or even ...

Let(

d = Get(CurrentDate);

Date(Month(d) + 1; 1; Year(d))

& "..." &

Date(Month(d) + 2; 0; Year(d))

)

I'm unsure if Let() helps here but it's sure easier to work with. wink.gif

LaRetta

  • Author

thanks for the replies , I shall try both of those

  • Author

Ok, I've got Laretta's first calculation working fine in FM7.

But I couldn't get aaa's calc working in FM5.

this is what I have entered in the Insert calculated result box as a script step (which I am happy to use insert calc result in a script as I do have the field on the layout)

DateToText(Date(Month(today),1,Year(Today))&".."& DateToText(Date(Month(today)+1,1,Year(Today))-1)

  • Author

It's Ok , I've worked out what I did wrong.

I am now trying to go one stage further and instead of having a button to trigger the script, I would like to have a pop-up menu that lists not only the name of next month but all of the following months.depending on which month was clicked, it would alter the script to account for the month chosen.

How easy would it be to create a value list based on a calculated result (i.e. always show the following months and not a static list.

thanks again

You must have one global field Month_Global where will you put your choosing month then in expression instead Month(today) you must put Month_Global.

Other way is to create 12 buttons and 12 scripts. For user this way is more appreciate.

  • Author

the problem I see with the buttons is that if the current month is June and someone clicks the January button it would show records from the previous January and not the forthcoming one.With your first suggestion , should I create a value list with all 12 months? I'm a little unclear of this.

thanks

Yes! You right. You must create value list. Today i finishrd my work. Tomorrow, if you can not solve your problem, i will attach you example.

You must choose Month_Global from Value List then find by:

DateToText(Date(Month_Global,1,Year(Today))&".."& DateToText(Date(Month_Global+1,1,Year(Today))-1)

  • Author

thanks , an attachment would be very useful

I did it for you. See attachment.

Datas.zip

  • Author

thanks , i will have a play with that

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.