To find the records you want:
Enter Find Mode
Set Field [YourTable::Date ; "> " & Date ( 1 ; 1 ; Year ( Get (CurrentDate) ) - 2 ) ]
Set Error Capture [on]
If [Get ( FoundCount ) > 0 ]
Sort [Restore ; No dialog ]
Show Custom Dialog ["No records in this date range were found..."]
To group your records as described, you can create a summary report and the sort step in the above script can be set to sort the records in an order that supports the structure of the summary report.
The Summary Field, sLastOrder defined as Maximum of your record's order date will return the date of a given customer's most recent order if the records are sorted by Customer ID.
Then the following calculation, cOrderAgeCategory can compute a value you can use to group the records by elapsed time in days since last order:
Let ( Age = GetSummary ( sLastOrder ; CustomerID ) - OrderDateField ;
Case ( age < 30 ; 1 ;
age < 90 ; 3 ;
age < 120 ; 6 ;
7 ) /*case */
) /* let */
You would sort the above records first by Customer ID, then cOrderAgeCategory. You can add sub summary layout parts when sorted by Customer ID to put in a heading for each customer group of orders and you can then include below it a sub summary part when sorted by cOrderAgeCategory to show a breakdown of orders by age.
If summary reports are a new concept, you may want to read this thread: Creating Filemaker Pro summary reports--Tutorial