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

TRIM? 2

Status
Not open for further replies.

drinker

Technical User
May 9, 2006
57
US
Crystal 8.5

I have two fields {Part.ID} and {Part.Material_Code}

What I need to show is when these two fields do not match. The problem is that I need the report to NOT look at the last Two ( 2 ) numbers in the {Part.ID} field.

EX: {Part.ID} = 410D-E01-13
{Part.Material_Code} = 410D-E01

I want the report to see that these two part numbers match.

What would the formula be to accomplish this? Thank You.
 
Hi,
What do you mean by:
What I need to show is when these two fields do not match

Only get records that match that criteria?


More Importantly:
What Database, version and connection method?

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If with the critera I mentioned is true than I need the Field {Part.ID} to Show.
 
The following formula will remove the last two digits and dash from the Material Code which will allow you to compare it to the ID
//{@MaterialCode}
Mid({Part.Material_Code},1,(length({Part.Material_Code}-3))
 
I am getting a the ) is missing error
 
Since these fields are in the same table, I think you just need a record selection formula of:

{part.id} <> left({part.material_code}, len({part.id}))

Or you could also try:

not({part.material_code} like {part.id}+"*")

-LB
 
I'd go with LB's:

not({part.material_code} like {part.id}+"*")

or create a SQL Expression which trims off the extra 2 characters and use it in the record selection as the mid function likely won't get passed to the database.

Of course to use a SQL Expression, you'd have to have a certain type of database, and you incorrectly felt that sharing database information is unimportant when discussing filtering data...it doesn't take much more time to describe your environment properly.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top