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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula using FirstRecord and previous not working on first record

Status
Not open for further replies.

themich

Technical User
Jul 15, 2011
9
US
I'm trying to get this formula to return "OK" for the firstrecord of the report and "DUP" if the subsequent records match the previous.

Here's where I'm at currently:

if ({@Check or Deposit ID}) = previous ({@Check or Deposit ID})
and ({@firstrecord}) = false
then "DUP"
else "OK"

However, it's not returning "OK" for the first record, it acutally returns a blank. I checked the field w/the firstrecord formula and it returns "true".

I don't know where to go from here.
 

You can use the recordnumber function to automatically plug in a value for the first record without writing an additional formula:

if recordnumber = 1 then "OK"
else
if {@Check or Deposit ID} = previous ({@Check or Deposit ID})
then "DUP"
else "OK"

 
Or you could change the order of your if statement to something like this:

If not OnFirstRecord and {@Check or Deposit ID} = previous ({@Check or Deposit ID})
then "DUP"
else "OK"

You need the check for "First Record" to come BEFORE the check for Previous.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top