Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Search for strings with dashes but leave dashes out of search string...???


This topic is 6380 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

If we have the following in our DB: 603-900055-201 and I do a Find for 603900055201 it does not find the part. Is there a way I can make that work because it's kind of a pain..??

I can't seem to find any wildecards that will make it work. Any info would be great. thanks!

Posted

what if you created a field that was a calculation.

Filter( SerialNumber ; "0123456789")

And then you could search on the field with numbers only.

Would that work?

Posted

You could create an auto-calculation instead of just a calculation. Just make sure that you uncheck "Do not replace existing value of field (if any)"

Posted

A stored calculation field would get indexed, and searching it should be no different than searching a text field.

If your field is standardized to the ###-######-### format, you could have a script format the request in the same way.

Posted

603-900055-201 and I do a Find for 603900055201. I can't seem to find any wildecards that will make it work.

search on the field with numbers only. Filter( SerialNumber ; "0123456789")

If your field is standardized to the ###-######-### format, you could have a script format the request in the same way.

Yes but it would require User inputting the entire part number otherwise how would script know position to generically wildcard the remainder? I would prefer a less rigid approach. DrewAngel, since you are creating a calculation to hold the raw numbers (although the field should be text) then why not give your Users a break and accept any string in any position within the field? The calc does not have to be on the form; you can still let Users search your partNumber field. Script might then look like:

Set Error Capture [ On ]

Enter Find Mode [ pause ] [color:gray]the Users type what they are searching

Set Field [ theCalc ; "*" & Substitute ( partNumber ; "-" ; "" ) & "*" ]

Set Field [ partNumber ; "" ]

Perform Find [ ]

If [ not Get ( FoundCount ) ]

... no records

Else

... records found

End If

This script is a bit more forgiving: they can accidently enter the dash and it will be ignored; they can remember only part of the number and it will be found regardless, and it will be quicker for your Users to enter instead of a long numeric string. It's just another option ... only you can decide which might work best in your situation.

LaRetta :wink2:

This topic is 6380 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.