Zcast Posted November 21, 2009 Posted November 21, 2009 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.
LaRetta Posted November 21, 2009 Posted November 21, 2009 (edited) One way: Enter Find Mode [ uncheck pause ] Set Field [ yourDate ; "{" & globalQuarter * 3 - 2 & ".." & globalQuarter * 3 & "}"& "/" & globalYear Perform Find [ ] Edited November 21, 2009 by Guest Corrected quarters
Zcast Posted November 21, 2009 Author Posted November 21, 2009 It tells me that I have Invalid search criteria...
LaRetta Posted November 21, 2009 Posted November 21, 2009 (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 November 21, 2009 by Guest Added sentences
Zcast Posted November 21, 2009 Author Posted November 21, 2009 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.
LaRetta Posted November 22, 2009 Posted November 22, 2009 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?
Zcast Posted November 22, 2009 Author Posted November 22, 2009 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.
LaRetta Posted November 22, 2009 Posted November 22, 2009 (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 November 22, 2009 by Guest Added version question
Zcast Posted November 22, 2009 Author Posted November 22, 2009 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now