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

Selecting ONLY Duplicate records Based on formula field

Status
Not open for further replies.

tkaplanusmc

Technical User
May 18, 2010
20
US
I have a formula field named @Next with the following formula:

if {Job_Operation.Sequence} + 1 <> Next({Job_Operation.Sequence}) then "Skipped Operation"

it shows up in my report like this:

Page -1 of 1



Work_Cente equence Status Statu Next
11111
TIG WELD 0Active O
INSPECTIO 1Active O Skipped...
INSPECTIO 3Active O
STAGE 4Active O Skipped...

11111-001
INSPECTIO 0Active O
SAW 1Active O
LATHE 2Active O
MACHINING 3Active O
INSPECTIO 4Active O
STAGE 5Active O Skipped...

Based on this I want to filter for only Jobs (e.g -11111) with at least 2 if not more duplications of Skipped Operation in the Next field.

Thank you in Advance



 
The formula that you're creating gets calculated at print time - whereas a filter for the report needs to run prior to print time - hence it's a real challenge!

Your best bet is to base the report on a stored procedure that loops through the records to determine skipped sequences. I'm sitting here grappling with how the heck to do that without using a cursor, and I'm not sure it's possible - but it's definitely do-able with a cursor. What is your data source? Do you have access to the database such that you could write a stored procedure?

You CAN use a manual running total formula to display the number of skipped sequences on a report so that at least they're flagged as "problems" (or whatever). That formula could also be used to change the formatting of the footer section that contains 2 or more skipped sequences - but not as a filter.

Sorry - I know this isn't encouraging...

 
Hi Cindy thank you for the fast response. I am accessing the database via ODBC. I did see a table in the database entitled "Reports" that looks like it may have held some data linking exsisting reports to the database somehow but I don't know for certain. I'm not very skilled in the database world. and I'm fairly new with crystal report development
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top