Newbies EricCheesey Posted June 13, 2007 Newbies Posted June 13, 2007 Hi All. I have a small filemaker DB that has contacts, jobs and invoices tables. I would like to create a script where i can select a date range from a popup menu to fill in start date and end date based on the invoice date. The invoice date field is formatted "dd month year". How do a make the script to work so it will pick the date range that => and =< ? Many thanks in advance.
stanley Posted June 14, 2007 Posted June 14, 2007 Eric: So long as your invoice date field is an actual date field (not a text field), this is a fairly simple operation. If you set up your layout so that you have two date fields for the user to enter dates into - let's call them StartDate and EndDate - then in your script, you will want to enter Find Mode, then use Set Field[] to set your Invoice Date field to StartDate & "..." & EndDate, then perform the find. The ellipsis (the '...') is what is used in FM to indicate a range, so this will find any dates between (and including) the two dates indicated. -Stanley
Newbies EricCheesey Posted June 14, 2007 Author Newbies Posted June 14, 2007 Thanks Stanley. Yes the Invoice field is a date field and not a text field. With the two new fields do I just make them as a standard date field and not a global ?
mr_vodka Posted June 14, 2007 Posted June 14, 2007 Global date fields should be used. BTW you could also use a Go to Related Records with an additional table occurence to the invoice table. The join would have to be a theta join keyed as following: gStartDate <= InvoiceDate gEndDate >= InvoiceDate
rangebob Posted June 15, 2007 Posted June 15, 2007 Thanks for this thread this is what I've been trying to figure out how to do. I'm having problems with it working. I created the script as stanley showed and I keep getting no records match this request. I know that there is matching records that should be found. Thank you for your help.
mr_vodka Posted June 15, 2007 Posted June 15, 2007 You are on FM6, try this: Enter Find Mode [] Insert Calculated Result [ DateToText( StartDate ) & "..." & DateToText(EndDate) ] Perform Find []
Recommended Posts
This topic is 6372 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