Hi Deborah,

Further to Tom's excellent suggestion ...

First create a cartesian (all records) relationship between the table and itself - let's call the original table occurrence TO1 and the new one TO2

then create 2 calculation fields, evaluated in the context of TO1:

Numeric_Accession_Number = GetAsNumber ( Accession_Number ) [Numeric result]

Max_Accession = Max ( TO2::Numeric_Accession_Number ) [result probably numeric but could be text]

the latter should give what you need.

... you could also use the technique where the relationship is defined to include a sort order, Descending Sort by Numeric_Accession_Number, in which case you can simply use:

Max_Accession = TO2::Numeric_Accession_Number

to get the first value found as defined by the relationship: in our case this will return the highest Numeric_Accession_Number. This negates the need for the Max ( ) function.

You can extend this by using the GetNthRecord function to get the 2nd, 3rd, etc, highest number. Also remember that you can change the default sort language for a field (eg, "English" sorts differently to "Unicode").

Regards,
Tim.

--
Tim Mansour <[EMAIL PROTECTED]>
Neologica Print & Promotions (ABN 63 904 335 408)
159 Commonwealth Street  Surry Hills NSW 2010
Sydney 02 9212 1789  Melbourne 03 9012 7441  Mobile 0405 500 846

Reply via email to