This is a Find and Sort Report. List view with a summary field to count whatever is your sort field (Type).
Enter find mode
set field Date ; x/x/x...x/x/x
set field Status ; Booked (or 2, if this is numbered)
Sort by Type (if this is a value-list, then the sort can be on that order or by alpha - asc or desc)
Manually do this or script it.
Thank you Beverly,
I apologise as I am not up enough on the scripting to follow your instructions. I am using FMP14 and when I try to script it doesn't look quite like your instructions. What I get is what you see below and it obviously doesn't work. I have 2 fields for Start and End dates as well which somehow need to be included in the script I guess. Thank you again and I know I just need a bit more of a detailed (novice) explanation and I should get there.
No, it does not. If I just type and use the square brackets, the forum messes with the coding. Here, let simulate with your fields and write the script (as a screenshot)
change the date range as needed
The Sort Records looks like this:
How to use the SET FIELD script step.
Maybe this series of screen shots will help.
There are two basic parts of "set field"
1. Which field?
2. Set the contents of this field to what?
Note that at step 1, you have the option of specifying a repetition number.
Repetitions are used rarely, normally you just leave this as 1.
We specified a field AND set a repetition. Mostly you leave the rep as 1.
Result if no rep specified:
Result if a rep was specified:
Thank you again Beverly and that works nicely for a predefined find.
So what I need to do now is run that script based on the date fields I have setup rather than a predefined date.
I also want to be able to choose the Status from a list.
In summary I want to be able to select a Start date and End date and the Status and then run a report via a script.
That makes perfect sense now. This was a sticking point for me but now I get it. Thank you very much.
I figured the date part out with 'Contacts::StartDate&"..."&Contacts::EndDate' but just need to know how to filter by Status.
right! globals for choices would be what I would do. Then in the "set field" you can specify the globals.
(in find mode...)
set field ( date ; from & "..." & until )
set field ( status; status_global)
(you can even use the valuelist in the find mode)
very do-able! I tend to check for date range (end being after start, for example) by validation before processing the actual find. And after the perform find, add a dialog if nothing is found. But that just makes it's better user interface.
Beautiful. Thank you Beverly. Working well now.