Squeezebox Posted June 11, 2008 Share Posted June 11, 2008 Hey everybody, I'm new to using Filemaker and I need a little help. I'm using Filemaker Pro 6 and I'm trying to get a specific date script to work. Pretty much what I'm aiming for is a script that is basically like this: If the "Date Field" containing the date is less than the current date, then make all dates the current date. I'm just a novice when it comes to using Filemaker and this may or may not be simple, but I really could use the help. Note that I need all records to change if that statement holds true, not just the one being browsed. I appreciate your time and thank you in advance! -Squeezebox Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted June 11, 2008 Share Posted June 11, 2008 It's bad form to post the same question twice. People like to see what answers have already been provided before starting to type out an answer, and if someone later on does a search and finds one out of two copies of your post, they will not realize that a better answer is to be found on the other copy. You say you are a novice: do you want to actually CHANGE (i.e., overwrite) the Date Field with current date for every record where the Date Field is a date earlier than today? Or do you want a new and different field that will DISPLAY today's date unless the original Date Field is for a later date, without destroying your data in the Date Field? And if you DO want to change the Date Field data, do you need to do this over and over, like this week and also do the same thing again next week, or is this a one-time thing? a) To change the data just once, do a Find for all records where Date Field b) To do it via script, so you can do it by the click of a button as often as you need to, create this script and attach it to a button: Enter Find Mode [] Insert Calculated Result [" Set Error Capture [On] Perform Find [] If [status(CurrentFoundCount) =0] .. Show Message ["ain't none" / OK] End If Replace Field Contents [Date Field, calculated value Status(CurrentDate)] c) To make a display field that does not overwrite your existing Date Field value but shows either today's date or the value of Date Field, whichever is greater, create a calculation field of result type "date" defined as Case (Date Field > Status(CurrentDate), Date Field, Status(CurrentDate) ) Set the storage on that field to "unstored" or it won't evaluate Status(CurrentDate) properly. Quote Link to comment Share on other sites More sharing options...
Squeezebox Posted June 11, 2008 Author Share Posted June 11, 2008 I have a lot of records that contain a "Call Back Date" field that has current dates in it. I'm looking for a way to make it so I can just click on a button and it will automatically change the dates in every record in "Call Back Date" ONLY if it is less than the current date that the button was pushed. Say I have 1/6/08, 1/7/08, and 1/8/08 ... When I push the button on 1/10/08 ... Those three dates above, in different records, automatically change to 1/10/08 ... Quote Link to comment Share on other sites More sharing options...
Squeezebox Posted June 11, 2008 Author Share Posted June 11, 2008 I have it kind of narrowed down now. The only problem I have is getting it to insert the " Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted June 11, 2008 Share Posted June 11, 2008 Even when you are using "Insert Calculated Value"? hmm... OK let's get down & mean with FileMaker 6... do this instead: Insert Calculated Value [Date Field, " sorry, they made scripted Find Mode for dates a lot less weird beginning with FileMaker 7, I forget sometimes how we had to jump thru hoops when scripting finds on dates back then! Please DO leave your Date Field formatted as a date. Quote Link to comment Share on other sites More sharing options...
Squeezebox Posted June 11, 2008 Author Share Posted June 11, 2008 You're awesome! Thanks man I really appreciate it! smiley_cool Quote Link to comment Share on other sites More sharing options...
Melodee Posted July 1, 2008 Share Posted July 1, 2008 Thanks from me, too! I spent an hour trying to figure out something that took me one minute to find here. smiley-laughing Quote Link to comment Share on other sites More sharing options...
LexaK Posted July 10, 2008 Share Posted July 10, 2008 Hey everybody, I'm new to using Filemaker and I need a little help. I'm using Filemaker Pro 6 and I'm trying to get a specific date script to work. Pretty much what I'm aiming for is a script that is basically like this: If the "Date Field" containing the date is less than the current date, then make all dates the current date. I'm just a novice when it comes to using Filemaker and this may or may not be simple, but I really could use the help. Note that I need all records to change if that statement holds true, not just the one being browsed. I appreciate your time and thank you in advance! -Squeezebox Could you just replace contents? You could call up all records (Ctrl-J), sort by date (descending), and with your cursor in the field that has today's date, Replace Contents (Ctrl-=). This of course only works if the date field is not an auto-entry, but it will work if it's a text field that is manually entered. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.