[FX.php List] Last N Records
Alex Gates
alex at gandrpublishing.com
Mon Aug 25 10:12:26 MDT 2008
Jonathan -
You can specify the groupsize to return with a FindAll -
From the docs about FindAll:
"Only the number of records specified by the $groupSize parameter of
SetDBData() will be returned."
So, like ggt said.. specify your groupsize, sort descending from rec id,
then FindAll.
Alex
Jonathan Schwartz wrote:
> ggt,
>
> Perhaps I'm missing something obvious, or my question is unclear.
>
> If I have 100,000 records, I obviously don't want to FindAll and then
> just use the last 100 records.
>
> If I find less than ALL, then I need to tell FMP which ones....right?
>
> There isn't a command FindLast (100).
>
> Other than issuing two queries, one to determine the number of total
> records and one to skip all but the last 100 records from the number
> found in the first query, I dodn't have an answer.
>
> Perhaps the two query method is the best?
>
> J
>
> I
> At 3:25 PM +0200 8/25/08, Gjermund Gusland Thorsen wrote:
>> I am sure you have an auto increment or you can make autoenter
>> calculation by get(recid)?
>>
>> I would sort descending by that autoincremented number and have the
>> number of records returned set to N
>>
>> Gjermund
>>
>> 2008/8/25 Jonathan Schwartz <jschwartz at exit445.com>:
>>> Looking at my Log file...on an iphone. Just want to see the last 10
>>> records
>>> or so.
>>>
>>> Don't want to return the whole file (100,000+ records and growing)
>>> and sort
>>> descending just to see the last 10 records.
>>>
>>> See what I mean?
>>>
>>> Now, you might say...just query "TODAY" and then sort.
>>>
>>> But..what it it wasn't a log file where you could predict the last
>>> records
>>> fell under a single day?
>>>
>>> Still need a way to grab just the last N records with no other criteria
>>> needed
>>>
>>>
>>> Jonathan
>>>
>>>
>>> At 1:26 PM +0200 8/25/08, Gjermund Gusland Thorsen wrote:
>>>>
>>>> Ehh, what are you doing?
>>>>
>>>> the last N records of a table?
>>>>
>>>> how about sort descending, and change return amount to N?
>>>>
>>>> ggt
>>>>
>>>>
>>>> 2008/8/25 Jonathan Schwartz <jschwartz at exit445.com>:
>>>>>
>>>>> Hi Folks,
>>>>>
>>>>> Looking to query and return just the last N records of a table.
>>>>>
>>>>> I thought of using two queries: the first to get record count and
>>>>> the
>>>>> second
>>>>> to use the skip parameter.
>>>>>
>>>>> Is there a single query method?
>>>>>
>>>>>
>>>>> J
>>>>> --
>>>>> Jonathan Schwartz
>>>>> Exit 445 Group
>>>>> jonathan at exit445.com
>>>>> http://www.exit445.com
>>>>> 415-370-5011
>>>>> _______________________________________________
>>>>> FX.php_List mailing list
>>>>> FX.php_List at mail.iviking.org
>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>> --
>>> Jonathan Schwartz
>>> Exit 445 Group
>>> jonathan at exit445.com
>>> http://www.exit445.com
>>> 415-370-5011
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
More information about the FX.php_List
mailing list