Newbies Penbrook Posted June 25, 2009 Newbies Posted June 25, 2009 A Custom Dialog allows user input for "Initial Date" & "Final Date". These 2 dates are stored. I would like to create a script that uses a date range in order to find all invoices within that specified range by the user through the Custom Dialog variable # 1 & variable # 2. Nevertheless the Perfom Find [] within the script doesn't allow "Date" to use the stored value in those two variables (it is expecting a "valid" date and not the name of another date variable name). Any suggestions? How can you use the range specified by the user in the Custom Dialog in order to perform the find ? Thanks!
mr_vodka Posted June 25, 2009 Posted June 25, 2009 You can set the field in find mode instead of explicitly in the Perform Find script step. If for example you are capturing your user selection into global fields then... Enter Find Mode [] Set Field [ YourDate; gDateStart & ".." & gDateEnd ] Perform Find []
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 Would I use the same thing if I was setting a Perform Find Script to find records over 5 days old?
mr_vodka Posted July 16, 2009 Posted July 16, 2009 Wouldnt that be just adjusting the start and end dates?
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 Im confused how to set it for 5 days greater than today...
mr_vodka Posted July 16, 2009 Posted July 16, 2009 Sorry I dont know what you are asking. If you want to find records that have a date that start 5 days from now, your start date would be, 07/21/2009.
comment Posted July 16, 2009 Posted July 16, 2009 Try: Enter Find Mode [] Set Field [ YourDate ; Get(CurrentDate) & ".." & Get(CurrentDate) + 5 ] Perform Find []
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 Try: Enter Find Mode [] Set Field [ YourDate ; Get(CurrentDate) & ".." & Get(CurrentDate) + 5 ] Perform Find [] what does the [ & ".." & ] part of the code do? Forgive me I want to know how to come up with this not just the answer...
mr_vodka Posted July 16, 2009 Posted July 16, 2009 (edited) Its an indicator for a range. http://fmhelp.filemaker.com/fmphelp_10/en/html/find_sort.5.6.html Edited July 16, 2009 by Guest added link
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 YourDate ; Get(CurrentDate) & ".." & Get(CurrentDate) + 5 The difference in Yourdate and Current date. Im not understanding this...
comment Posted July 16, 2009 Posted July 16, 2009 [color:blue]YourDate is the target field. [color:blue]Get(CurrentDate) & ".." & Get(CurrentDate) + 5 is the calculated result. See: http://fmhelp.filemaker.com/fmphelp_10/en/html/scripts_ref1.36.39.html
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 when I input that as the calc in the set field it says its missing an operator where the semi colon starts?
comment Posted July 16, 2009 Posted July 16, 2009 You're not supposed to enter ALL of "that" as the calc - only the calculated result part. I suggest again you study the help page I linked to.
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 (edited) Ohhhhhhhhhhhhhhh Still looks the same as what I was trying to enter in but you set the target... k i get it now... But that calc doesnt pull the records older than 5 days. It only shows todays records. When I just do a perform find based on that calc it shows no records when I have 3 over 5 days old in records. Edited July 16, 2009 by Guest
comment Posted July 16, 2009 Posted July 16, 2009 that calc doesnt pull the records older than 5 days. It only shows todays records. No it doesn't - you asked "how to set it for 5 days greater than today..." and it finds records that fall between today and 5 days into the future (inclusive).
sicSRT8 Posted July 16, 2009 Posted July 16, 2009 I really need to pay more attention to how I ask things... I need to go back into the past of 5 days...
mr_vodka Posted July 17, 2009 Posted July 17, 2009 I think that you have enough to go on to try and figure out the range starting from 5 days ago to the current date... ;)
sicSRT8 Posted July 17, 2009 Posted July 17, 2009 Well -5 takes last five days. so I set this to omit these records and that will show me remaining right? Is this the proper way to do it though meaning the calc? Or does it even matter how you do it as long as you get the answer your looking for.
mr_vodka Posted July 17, 2009 Posted July 17, 2009 Well there are always many ways to do things. For example, if you just want all records that are earlier than 5 days ago then you can use Enter Find Mode [] Set Field [ YourDate ; "<" & Get(CurrentDate) -5 ] Perform Find [] But then you talk about omitting them. Well you could stick in a show omitted only step or you can just find for the opposite. Enter Find Mode [] Set Field [ YourDate ; ">=" & Get(CurrentDate) -5 ] Perform Find [] Which will find all records greater or equal to 5 days ago... I dont know what you are looking for...
Newbies pshep Posted December 1, 2009 Newbies Posted December 1, 2009 Hi, Hope you can help. I am customising the Task Manager template that comes as part of FMPro 10. I want to be able to find tasks with an open status with a due date between and including "Date A" and "Date B". I have read your above notes but I still don't understand how to do this. Do I need to setup new global fields or can I work with what the template already gives me. Thanks in advance for any help you can offer
Recommended Posts
This topic is 5528 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