Hello everyone,
It seems that sorting the table is faster than using an array, even after
returning the selection to it's original order, only taking a few ticks on
55k records!
Below is my code should anyone else come across this. I tried it Execute on
Server but the method didn't see the current selection.
Thanks to everyone!
Alan

$pField:=$1
$pTable:=Table(Table($pField))
LONGINT ARRAY FROM SELECTION($pTable->;arCurSelRecs)
ORDER BY($pTable->;$pField->;>)
If (Defined ($2))

$pDate_min:=$2
$pDate_min->:=$pField->

End if
If (Defined ($3))

$pDate_max:=$3
LAST RECORD($pTable->)
$pDate_max->:=$pField->

End if
CREATE SELECTION FROM ARRAY($pTable->;arCurSelRecs)

On Wed, Oct 11, 2017 at 6:39 PM, Alan Tilson <alantil...@gmail.com> wrote:

> Arnaud,
> Max & Min don't work for date fields or date arrays it seems. I get values
> like 5.67746e+17? Is there a way to translate this to a date?
> Thanks,
> Alan
>
>
> On Wed, Oct 11, 2017 at 6:36 PM, Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>>
>> > Le 11 oct. 2017 à 23:30, Alan Tilson via 4D_Tech <4d_tech@lists.4d.com>
>> a écrit :
>> >
>> > Greetings everyone,
>> >
>> > Is there a way to get the earliest and latest dates from a selection of
>> > records similar to using Min/Max for numerical data?
>>
>> $max_d:=Max([aTable]aDate)
>> $min_d:=Min([aTable]aDate)
>>
>> Or what am I missing here?
>>
>> --
>> Arnaud de Montard
>>
>>
>>
>> **********************************************************************
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **********************************************************************
>>
>
>
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to