How to filter a data report

I have a report that right now display all quote number grouped by a date. In the 9/29/11 field I return quote numbers that are valid in both formats 10001 or 1000-1. The problem I need help with is that if a quote number is 1000-1 then it only returns that single number and not the 1000 number. The "-1" defines it as an updated quote so I would only want to display the most updated quote number.

I tried using an if else and a instr function but that did not do the trip.

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you using a parameter in the filter?

Are you doing any summaries in the report?

You could add a group by quote number (or really a group on a formula that is:

Suppress detail lines, just showing group header.

Insert a summary and choose Minimum, or Maximum of {table.quotefield} into the group header. Either MIN or MAX should should the quotes with -# if two quotes are present. Try both to see which yields your desired result.

Create a formula to extract the quote number part of the field.

A variation on GJParker's and LinInDenver's suggestions.

 Create a formula like:

 Split ({quote # field}, "-') [ 1 ]

 That's more flexible than using Left ({quote # field}, 5), which assumes that you will always have 5 characters in front of the "-".  If there will always be 5 characters, then using Left is fine.

 Group on the new formula.  Within the group, sort on the quote # field (the field, not the formula).  Suppress the group header (And details?) and put the quote # field in the group footer, and you should see the largest quote # in each group.

 Note that this all assumes that the number after the "-" will always be 1 digit/character.  If you could have numbers like 10000-9, 10000-10, 10000-11, this won't work, because 10000-9 would sort after 10000-10 and 10000-11.  If you could have numbers like those, you'll have to do some more work to find the highest number.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.