February 17, 200619 yr as a script step, i would like to find records in my database which range 2 days less than through two days greater than todays date i can get records where x field has todays date by perfrom find = data::x =// but cannot figure out the script formula for a range of days off of the current date...such as data::x =<2...//...>2 it must be simple, but i am stumped. thanks for any help you can give arfus nyc Edited February 17, 200619 yr by Guest
February 17, 200619 yr Enter Find Mode [ ] Set Field [ Untitled::aDate; Get ( CurrentDate )-2 & "..." & Get ( CurrentDate )+2 ] Perform Find [ ] --sd
February 17, 200619 yr here's simple script enter find mode [] set field (date, Get(currentdate)-2 & "..." & Get(currentdate)+2) perform find. HTH
February 20, 200619 yr Author thank you for your help. in that you all are in a concensus, clearly i am missing something here. i am creating the script with scriptmaker and do not understand the script step: Set Field [untitled::aDate; Get (Current Date) -2 & "..." Get (Current Date) + 2] The field that i am performing the search in (for example) is "departure info" which is already a calculated value with a date return from fieldname "departure date" Beyond my confusion of how the set field fucntion works, I think that 'current date' may be confusing. I am requesting records where the date in 'departure info' field equals from plus to minus 2 days from todays date. does that make sense? me confused much?
February 22, 200619 yr ... Ok, Get(CurrentDate) is a filemaker function that gets the current date... i.e todays date, therefore Get(CurrentDate) today would evaluate to 22/02/06 ... Get(CurrentDate) - 2 would evaluate to 22/02/06 - 2 days = 20/02/06 Therefore the total equation: Get(CurrentDate) - 2 & "..." Get(CurrentDate) + 2 would today evaluate to: 20/02/06...24/02/06 Now, thats the data that gets entered into the field.. The set field script step, simply sets any field you specify within the current table (or a table related to the current table) to whatever you specify in your calculation... which in this case would be the calculation Get(CurrentDate)-2 & "..." Get(CurrentDate) + 2 Finally, the filemaker find ... engine... can do range searches. A range search is delimited by 3 periods in between your lower value and your higher value, and filemaker will return to you all records that fit into your criteria... so in a normal find situation if you just entered 20/02/2006...24/02/2006 into a date field, all records that have a date between or including those two dates, would be returned to you... Finally, summing up all the script does is enters find mode, sets the field Untitled::aDate = the result of the calculation Get(CurrentDate) - 2 & "..." & Get(CurrentDate) + 2 and then performs a find, thereby returning to you your original request of all records between those two specific dates... as always, i hope this helped and lessened your confusion ~genx
February 22, 200619 yr Instead of specifying the field Untitled::aDate in your database, especially seeing as it in most likely hood doesnt exist, just specify your field, "departure info" or "departure date" or whatever the field you want to search in happens to be... Remember, you are doing all of this in script maker, and then executing a script to find your records, you are not using a calculation field (though you could).. anyway, yeh... good luck ~genx
Create an account or sign in to comment