Question - find highest number in a field out all the records

Josh Reader josh.reader at mercuryelectronics.com
Wed Aug 22 09:33:15 PDT 2018


Hi Michael,

If you do it in a report, select the needed records and then in the report processing set a variable to hold the highest value @once.  Then compare on each record to see if that variable is greater than whatever field number the value is in.  Be sure to make the variable global and that it matches the type of the field (ALLUP, .0, ALNUM, etc).   Use a print command @wgt and add *hv to the report in the grand total section.  For instance let's say your values are in field 2 and it is set to be an 8 character number with no comma separator:

	If: 	2 gt hv		' Current value is higher than what is in the variable
	Then:	hv=2		' Replace value in variable with higher value
	If:	' Get next record
	Then:	end
@once	If:	' Highest Value Variable
	Then:  hv(8,.0,g)=""
	If:          ' End @once processing
	Then:	end
@wgt	If:	' Show the grand total section
	Then:	print
	If: 	' End processing
	Then:	end


Josh


-----Original Message-----
From: Filepro-list <filepro-list-bounces+josh.reader=mercuryelectronics.com at lists.celestial.com> On Behalf Of Michael Thompson via Filepro-list
Sent: Wednesday, August 22, 2018 11:54 AM
To: filepro-list at lists.celestial.com
Subject: Question - find highest number in a field out all the records

 I have a question. How do I get the greatest number in a certain field out of all the records.
Example: I want pull the 4999 out of all the records to display in field or report.

rec#   -   Field Value
1.      -       1999
2.      -       4999
3.      -       3999
4.      -       2999
5.      -       4999
6       -       3999

Thanks,



Michael Thompson, Senior Network Analyst
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20180822/6a1921b2/attachment.html>
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes http://mailman.celestial.com/mailman/listinfo/filepro-list


More information about the Filepro-list mailing list