Re: Finding a list of things in FMPro
Re: Finding a list of things in FMPro
- Subject: Re: Finding a list of things in FMPro
- From: Gary Lists <email@hidden>
- Date: Fri, 23 Jan 2004 07:58:55 -0500
Nigel Smith wrote [1/23/04 4:36 AM]:
>
The only
>
reason I'm even doing this is to get round FMP's portal searching
>
limitations, where searching on two portal fields gives all related records
>
which match either of those fields. What I want are the records which match
>
*both* the fields. I normally get round that by having a search field that
>
is a concatenation of both (or all) fields I'm interested in, but this time
>
one is a date, and I want to do greater than, less than, and so on.
>
>
Any other suggestions on how to get round this would be great,
When you say 'one is a date', that could mean that the field definition is
of the Date type, in which case the underlying data (as entered) could be in
almost any format. The date field definition gently forms that into a date
formatted according to your system settings. It's better (IMO) to treat
dates as numbers (for comparison) because the formatting of the string
displayed is user-dependent for date fields.
However, the date object can be turned into a useful value here. You can
turn the date into a number in FM (by calc field) and then into a string (if
needed) for AS.
Use the string representation of the number value to pre-pend to your other
key, to form the multi-key field value.
tell database 1 to set md to cell "DATE_3_cn" of first record
-- the field 'DATE_3_cn' is defined as a Calculation > Number result
-- the calculation is entered by just double-clicking the actual date field
-- the result is a number that you can compare or convert to string
-- for concatenating into a multi-key key
--> "732340"
tell database 2 to set cd to cellValue of cell "DATE_3_cn" of first record
-- "731603"
You can use that value in AS to build up your query, then you can search for
matching multi-key items.
--
Gary
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.