The selectduplicates statement selects records containing duplicate information in the database.


This statement has one parameter:

formula – tells Panorama what data to check for duplicates. If the formula is empty ("") Panorama will check in the current field. If the formula is not empty the formula will build the data that is actually checked for duplicates. For example to look for records where both the first name and last name are duplicated, the formula would be FirstName+" "+LastName.


This statement selects records containing duplicate information in the database. To work properly, the database must be sorted according to the formula used (see the examples below).

This example selects records with duplicate check numbers.

field «Check#»
selectduplicates ""

This example selects all records with duplicate names (both first and last name must be duplicated).

field LastName
field FirstName
selectduplicates LastName+", "+FirstName

As it searches for duplicates, the selectduplicates statement checks to make sure that the data is sorted in the order required by the selection formula. If the order is incorrect, it will display a notification warning you that it is possible that not all duplicates will have been selected (duplicates are only selected if they are adjacent to each other in the database before the operation begins, hence the need for sorting).

If you want your code to perform some other action if the sort order is incorrect, use the selectduplicatesnowarning statement in combination with the info(“selectduplicatesortwarning”) function, like this:

selectduplicatesnowarning LastName+FirstName[1,1]
if info("selectduplicatesortwarning")
    message "Warning -- some duplicates may not have been selected"

The selectduplicatesnowarning statement is nearly identical to this statement, except that it does not automatically display a user visible notification if the data is not sorted correctly – the action to take is up to your code.

See Also


10.0No ChangeCarried over from Panorama 6.0.