selectduplicates
FORMULA

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


Parameters

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.


Description

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#»
sortup
selectduplicates ""

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

field LastName
sortup
field FirstName
sortupwithin
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"
endif

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


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.