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.

Brainfart over script issue

Featured Replies

Ok, here we go..

I'm having a brain fart over how to get this done:

I have 2 dropdowns:

Quarter: 1st, 2nd, 3rd, 4th

Year: 2009, 2010, and so on

I can easily run a report by quarter just fine, for the current year (2009), but how do I go about setting the correct search dates when I pick say 1st (Quarter), then (Year) 2010??? Without having the largest script known to man in my dataase? Any help or direction would be appreciated...I've tried several different ways, and Yes, I can do it wth a rather large script using PatternCounts, but I know there has to be an easier way with script parameters.

One way:

Enter Find Mode [ uncheck pause ]

Set Field [ yourDate ; "{" & globalQuarter * 3 - 2 & ".." & globalQuarter * 3 & "}"& "/" & globalYear

Perform Find [ ]

Edited by Guest
Corrected quarters

  • Author

It tells me that I have Invalid search criteria...

Hmmm, did you make sure the quarter and year were both globals? If they weren't, you wouldn't have any find criteria. And is your date a true date? Also, you have Advanced, what happens when you run debugger on it?

I wouldn't think international setting would matter (I believe that FM searches dates as month/day/year regardless but that might matter.

Anyway, here's a file. Can you spot the difference? :smile2:

SearchQuarters.zip

Edited by Guest
Added sentences

  • Author

It shows in my searchDate field as "{4th..6}/2009", but still says I have invalid criteria, and yes my dates and globals are correct.

It shows in my searchDate field as "[color:blue]{4th..6}/2009", but still says I have invalid criteria, and yes my dates and globals are correct.

It should be showing as: [color:blue]{4..6}/*/2009 and no quotes.

The only way I can make it break and produce your find criteria is if the date you are searching is text instead of date (but I still find a lot of records, only the wrong ones). FileMaker will not auto-complete a proper date unless you are searching a true date field. Are you using international dates? Even so and if I'm wrong about how they find, it would be finding days between 4th and 6th and any month (using the *). Have you tried my file?

  • Author

Hey LaRetta, Thanks for all your help. Your file was perfect, stupid oversight on my end, with the"4th", I simply forgot to change my quarter Vlist from 1st, 2nd, 3rd, 4th to just 1,2,3,4...everything work fine now, thank you again. You are always so very helpful.

Good to know. Strange that, I saw your 4th and so I changed my global quarter to text and typed 4th (in fact tried 1st, 2nd and 3rd also). The results placed into the date field dropped the 'th' completely and only inserted the numbers and worked anyway. You ARE using Set Field [], right? Just curious now why the text would have made a difference for you but not me.

What version of 10 are you using?

Edited by Guest
Added version question

  • Author

I'm using FM 10 Advanced. Yes, I am using SetField to set mydates. I also had to add just a wildcard to your script for the day, and everything works great now. Thanks again 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.