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.

Find last month orders

Featured Replies

hi

I have a field order date

I would like to make a script that omit the record if the order date is from the same month and year as the current timeStamp

I will trigger the script on the last day of the month.

My format in order date is 26/01/2005

it should not be 30 days back, but all the record from the same month

How do i make the script ?

The calculation you'll need will compare the month and year of today's date with the month and year of the order's date. Here's a boolean calculation that can be used in a number field so 1 means it's in the month and 0 if not. OrderDate is the field of type Date with the Order Date in it.

Let (

[

TodaysDate = Get ( CurrentDate ) ;

TodaysMonth = Month ( TodaysDate ) ;

TodaysYear = Year ( TodaysDate ) ;

OrdersMonth = Month ( OrderDate ) ;

OrdersYear = Year ( OrderDate )

] ;

( TodaysMonth = OrdersMonth ) and ( TodaysYear = OrdersYear )

)

Hi

you can make a script like this:

Enter Find Mode[omit records]

Set field [OrderDate;Date ( Month(Get ( CurrentDate )) ; 1 ; Year(Get ( CurrentDate )) ) & ".." & Date ( Month(Get ( CurrentDate ) )+ 1 ; 1 ; Year(Get ( CurrentDate )) ) - 1]

Perform Find

  • Author

Hi

you can make a script like this:

Enter Find Mode[omit records]

Set field [OrderDate;Date ( Month(Get ( CurrentDate )) ; 1 ; Year(Get ( CurrentDate )) ) & ".." & Date ( Month(Get ( CurrentDate ) )+ 1 ; 1 ; Year(Get ( CurrentDate )) ) - 1]

Perform Find

Thanks, could someone please explain the what the script does ?

Hi

if I have understood you correctly, this script MUST do what you needed !

Doesn't it ?

Thanks, could someone please explain the what the script does ?

What it does is to create a range for the find. In this case, it is creating 12/01/2005..12/31/2005

I'll presume that you know what Find is, so the basic calculation is saying set the field "OrderDate" with the range when in Find Mode.

The first part of the calculation is saying to use the current's month and Year, and the "1" as the day, and the second part is saying to use the current month and year and the 1 again, but to add "+1" to the current month (equalling 13), and from that then, subtract "-1", which will return the end of the 12th month.

HTH

Lee

  • Author

hi

The script is perfect, thanks a lot raybaudi

I was trying to learn how it works, Thank you for the explanation Lee Smith.

how should it look if you want to trigger it the 1. of the next month instead?

how should it look if you want to trigger it the 1. of the next month instead?

Enter Find Mode[omit records]

Set field [OrderDate;Date ( Month(Get ( CurrentDate ))-1 ; 1 ; Year(Get ( CurrentDate )) ) & ".." & Date ( Month(Get ( CurrentDate ) ) ; 1 ; Year(Get ( CurrentDate )) ) - 1]

Perform Find

and you can trigger it in whatever day of the next month (not only the first).

If you fire this script now, you will omitt all the records of November

  • Author

Thank you raybaudi :thankyou:

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.