Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Way to search for records made *since* a date?

Status
Not open for further replies.

HarryM86

Technical User
Oct 27, 2006
1
0
0
GB
Hi all,

First, nice to be here - great forums and members you got here :)

I'm doing a DVD rental database on FMP 8.5, and for each "Loan" record, there is a field called "DateLeased", in date format.

I need to be able to generate a report (or, for the moment, just find records) of DVDs that were leased *since* any given date.

I know I can just go into find mode and enter, for example, ">22/10/2006", but really the "since" bit needs to be inbuilt as it were, as new staff will probably have no idea about those characters! Also, I'm using the calendar date picker, so it's a bit tricky to enter in a > manually.

I assume the way to do this will be to create a find script that simply searches for any date bigger than the one specified, but I'm not really sure how to do that.

Thanks in advance for any help :)
 
Nice to see you here HarryM86..

First, I never let a user do a search on an input screen/layout.
Make a 'special' find/search screen, where you can put all the needed fields, buttons etc that you need to accomplish the search.
In all my years as developer I had never an application where the user had to search 'all' the fields visible on an input screen. The more you make it impossible for users to go 'where they can go', the better and saver for you.

On your original layout, place buttons for search, with a script to navigate to the search layout and put the application in find mode.

You can use a separate field with valuelist with all the needed/possible symbols like > < or '...' and a 'searchDateField'

With a calculation behind the screen you can concatenate those values into a searchstring and with the Set Field function make real date field equal to this value (still in Find mode)
The 'Perform Find' will make the real find routine.

This way you can manage all the possible 'dateperiods' the user will need, like > or < a given date, with '...' a range between 2 dates (use 2 globals for the date fields), 'translate' the dates into quarters (1st, 2de, 3th etc).

That's all the flexibility and ease of use you can have with a separate find/search layout.

Basically you need 4 scripts to steer the system.
After the user has hit the 'Find it' button you need to 'tweak' the navigation..
Or 0 records = message
1 record = go to original layout
> 1 record = go to list view (new layout) and the user can make a choice from the list to go to a specific record.

This is in a nutshell a robust, save, easy to use search system. Once you have this in place, you can copy/paste everything (layout and scripts) to every other application you make, just change the fieldNames.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top