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.

Search using Today, last week and last month

Featured Replies

I am new at using the scripting functions and calculations and am having problems trying to figure out how to create the calculations for a pop up window on the search page that will allow doing a search on all records created "today" and "the last week" and "the last month". I can create the pop up window, but do not know how to create the scripts for the above 3 time periods. If someone could reply with to this with the scripts, I would be very grateful.

Thanks in advance for your help - Sam

--

Two of the three are easy:

1) Today

Enter Find Mode()

SetField(Date, Status(CurrentDate)

Perform Find()

2) Last Month:

Enter Find Mode()

Insert Calculated Result[select, Date, Date(Case(Month(Status(CurrentDate)) = 1, 12, Month(Status(CurrentDate)) - 1 ), 1, Case(Month(Status(CurrentDate)) = 1,Year(Status(CurrentDate)) - 1, Year(Status(CurrentDate))))]

Insert Text[Date, "..."]

Insert Calculated Result[Date, Date(Case(Month(Status(CurrentDate)) * 2, Month(Status(CurrentDate)) + 12, Month(Status(CurrentDate))), 1, Case(Month(Status(CurrentDate)) * 2,Year(Status(CurrentDate)) - 1, Year(Status(CurrentDate)))) - 1]

Perform Find()

***For this script, the field "Date" must be on the current layout. "Select" must be disabled on the second two Inserts.***

3) It depends upon what you consider "last week". Monday to Sunday? Sunday to Saturday?

-bd

  • Author

Thanks BD,

The script you gave me was very helpful and I actually got it to work. What I should have asked for though was a script that will show the records for the last 30 days not the last month.

As far as this goes:

"3) It depends upon what you consider "last week". Monday to Sunday? Sunday to Saturday?"

I need a script that will give results for Monday to Sunday.

Thanks so much for your help, I am gratful for you spending the time to help me with these scripts.

Thanks again - Sam

I wish I'd known that, would have been a lot easier! I took "last month" to mean for instance "June". This is why exact specification is sooo important with clients!

Enter Find Mode()

Insert Calculated Result[select, Date, Status(CurrentDate) - 30]

Insert Text["..."]

Insert Calculated Result[Date, Status(CurrentDate)]

Perform Find()

For "Last Week" do you want the last 7 days OR the last Monday to Sunday period?

-bd

  • Author

Being somewhat new to scripting with FM and also being dyslexic, I am learning how important syntax is. Thanks so much for you help in this.

"For "Last Week" do you want the last 7 days OR the last Monday to Sunday period?"

Last Monday to Sunday would be what I would need.

Right now I am experimenting with CDML and Filemaker as a way of servicing my clients. At the present I am hosting their files with static web pages and am look towards the future where all of this will be dynamic. It will be easier and more robust for them and also more streamlined from my end in servicing their accounts. I am kind of getting out of my area of expertise and will probably be looking for someone to help get this up and running. Is this something you can do? Right now I am hosting part of the web site using a new Imac with Mac OS X Server.

Thanks again for your help - Sam

Sam Laundon

http://www.smilepix.com

picturing the perfect smile

781-899-2037

888-701-0627

Why so complicated?

LastMonth=

Date(Month(Status(CurrentDate)-1,1,Year(Status(CurrentDate))...Date(Month(Status(CurrentDate),0,Year(Status(CurrentDate))

Last30Days=Status(CurrentDate)-30

Dj

Couldn't do edit?!?

LastXDays=Status(CurrentDate)-X

LastWeek=

Status(CurrentDate)-Day(Status(CurrentDate))-6...Status(CurrentDate)-Day(Status(CurrentDate))

crazy.gif

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.