Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report Formula Assistance - find Duplicate Values

Status
Not open for further replies.

Jeffs23

Programmer
May 20, 2013
8
US
In my report, I have the following 8 fields. What I would like to do is if the value is the same in any of these, I need it to return a phrase "Duplicate Diagnosis" else pull nothing back (NULL).

Example - if the end user enters 724.02 in {Data.Diag1} and {Data.Diag4} - it would return my phrase. If they were all unique then NULL.

{Data.Diag1}
{Data.Diag2}
{Data.Diag3}
{Data.Diag4}
{Data.Diag5}
{Data.Diag6}
{Data.Diag7}
{Data.Diag8}
 
Assuming I understood hat you need, create a formula like this:

Code:
If (	
	{Data.Diag1} = {Data.Diag2} or
	{Data.Diag1} = {Data.Diag3} or
	{Data.Diag1} = {Data.Diag4} or
	{Data.Diag1} = {Data.Diag5} or
	{Data.Diag1} = {Data.Diag6} or
	{Data.Diag1} = {Data.Diag7} or
	{Data.Diag1} = {Data.Diag8} or
	{Data.Diag2} = {Data.Diag3} or
	{Data.Diag2} = {Data.Diag4} or
	{Data.Diag2} = {Data.Diag5} or
	{Data.Diag2} = {Data.Diag6} or
	{Data.Diag2} = {Data.Diag7} or
	{Data.Diag2} = {Data.Diag8} or
	{Data.Diag3} = {Data.Diag4} or
	{Data.Diag3} = {Data.Diag5} or
	{Data.Diag3} = {Data.Diag6} or
	{Data.Diag3} = {Data.Diag7} or
	{Data.Diag3} = {Data.Diag8} or
	{Data.Diag4} = {Data.Diag5} or
	{Data.Diag4} = {Data.Diag6} or
	{Data.Diag4} = {Data.Diag7} or
	{Data.Diag4} = {Data.Diag8} or
	{Data.Diag5} = {Data.Diag6} or
	{Data.Diag5} = {Data.Diag7} or
	{Data.Diag5} = {Data.Diag8} or
	{Data.Diag6} = {Data.Diag7} or
	{Data.Diag6} = {Data.Diag8} or
	{Data.Diag7} = {Data.Diag8} or
) Then	"Duplicate Diagnosis"

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top