Well, the SQL you describe IS performing a "find", it's just being done in a system that support SQL instead of FileMaker's more "query by example" type of performing a find. The SQL will produce a recordset object in most DB's that suport SQL, where FileMaker's "find" will produce a foundset of records--not exactly the same thing, but with a lot of similarities.
Can you describe in more detail what you need to do here? Perhaps this is a value list where you want to select the name, but enter the ID number?
Well, what I am tring to do is to create a script that will generate the 2-week span daily report on how many "Samples" a user has sent.
And in order to chieve and create a graph report:
1. Create "report_sample" table (UserID, date, totalSampleNumber)
2. Run a startup script to calculate and find out how many samples a logged in user has sent each day in a given 2-week period.
In a startup script, I have a section to find out how many records are there by the userID number, but since I only know the username (AccountName), I have to find out the userID....
And why wouldn't you want your start up script to perform a find for this?
Such a script can use Get ( Currentdate ) and Get ( AccountName ) to specify the criteria.
A relationship and Go To Related Records is also an option. The results can be nearly the same.
I guess I am thinking too much in SQL way and trying to solve and find the records in short way as possible.
I have decided to go with perform find and switching layouts....
Thanks for your input though. It helped me go forward..
Phil, you are totally right. :)
I am just so used to not to perform so many tasks. I think I do have to get used with it. There's definitely pro and cons on both FM and SQLs.
Thanks a bunch!!!!
FM based finds make simple queries in scripts by the developer and simple ad hoc queries by the user a breeze. But I find that as the complexity of the criteria and the tables' relationships increase, you reach a "tipping point" where it becomes easier to do in SQL--not something we can switch to in FileMaker today, but maybe the ability to craft SQL queries as an option in place of Perform Find queries will become possible in the future. (Not making any predictions here, just thinking wishfully.)