Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5538 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted (edited)

One way:

Enter Find Mode [ uncheck pause ]

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

Perform Find [ ]

Edited by Guest
Corrected quarters
Posted (edited)

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
Posted

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.

Posted

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?

Posted

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.

Posted (edited)

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
Posted

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.

This topic is 5538 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.