kenseye Posted February 15, 2002 Posted February 15, 2002 Given a field with a start date and a field with an end date, is it possible to script a date range for a find ex: 1/2/02...2/15/02?
Steven H. Blackwell Posted February 15, 2002 Posted February 15, 2002 Enter Find Mode Insert Calculated Result (into the date field) startdate &"..."& enddate Perform Find If StatusCurrentFoundCount=0 --do something to address null set EndIF HTH Old Advance Man
kenseye Posted February 15, 2002 Author Posted February 15, 2002 thanks for your response. I tried that already but always get an empty result when there should be a result. When pausing the script to see what's happening, the date field entries go in as an FMP date format and does not retain the 1/2/2002 format Does that make a difference?
kenseye Posted February 15, 2002 Author Posted February 15, 2002 I take that back... I get an error message that says the inserted calculation must be in 2/3/2002 format. Instead, this is the entry format: 730866...730896
Chuck Posted February 15, 2002 Posted February 15, 2002 Where is the information coming from? The number you are seeing are how FileMaker stores dates internally. Dates are simply the number of days since 1/1/0001. It sounds like the date is getting converted to a number somewhere along the line. Without knowing how you're getting the information that you're building the search on it's difficult to offer a suggestion. Perhaps you're having the user fill in some global date fields and then using a script to build the date range string. If this is the case, try changing the global date fields to global text fields. You'll need to do some error checking to make sure the dates are valid. If this isn't the case, then try the following: Insert Calculated Result [ DateToText( Date1 ) & "..." & DateToText( Date2 ) ] Chuck
kenseye Posted February 15, 2002 Author Posted February 15, 2002 Yes Chuck, you're right, it was data entered into a global date field. I' try setting them as text and converting from text to date. Thanks
bobsmith Posted February 15, 2002 Posted February 15, 2002 You will have to convert the dates to text. Insert Calculated Results DateToText(date 2) & "..." & DateToText(date3)
kenseye Posted February 15, 2002 Author Posted February 15, 2002 I made that change to a global text field and used Insert Calculated Result [Texttodate(date1)&"..."&Texttodate(Date2) and get: 730866...730896
kenseye Posted February 15, 2002 Author Posted February 15, 2002 I reverted the global text to global date fields, and used: Insert Calculated Result [ DateToText(Date1)&"..."& DateToText(Date2) and it worked great! Thanks a lot. You guys are the best resource for FMP.
Recommended Posts
This topic is 8321 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