Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

Find vs. Text Function search wildcard

I can use "@' to search for one wildcard character in Find. However, I want a script trigger that uses Text Function to evaluate a five-digit ZIP (formatted as text) for boolean=true for anything matching '593@@'. I.e., if the field has five alphanumeric characters, the first three of which are '593' with the final two being non-null. What does not work is:

 If(zipField='593@@')
Set Field (newPostal=zipField)
End If

What is the correct syntax? I prefer not to use the left three characters as a match since I also need five characters in the field.

Mark
0
MarkJulie
Asked:
MarkJulie
  • 3
  • 2
  • 2
2 Solutions
 
ThomDrozCommented:
Is the field type a number?
Change it to text and try it, it worked for me with @
0
 
MarkJulieAuthor Commented:
I checked. It is text, so back to debugging for another solution.
0
 
ThomDrozCommented:
Mark
Sorry a find works using that format "593@@"....
another option (if you change it to a number field or create a identical field that is a number
then ...
If(zipField=> 59300  and  < 59400')
Set Field (newPostal=zipField)
End If

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Will LovingPresidentCommented:
Mark,

Why not just use this:

If[ left( zipField ; 3 ) = "593" and length( zipField ) = 5 ]
   Set Field (newPostal=zipField)
End If
0
 
ThomDrozCommented:
Willmcn
i think left and length are the better answer...
0
 
MarkJulieAuthor Commented:
Both answers have been helpful. In the end, since this is not actually a ZIP field but 6-digits of text sometimes filled with 1-2  trailing spaces (but always xxx.xx formatted with a decimal, I used GetAsNumber (Left,3 (zipField)) to evaluate the range and a Not Equals on one specific value in the middle of the range. Superb work for not enough points. (I thought it was a no-brainer.)
0
 
Will LovingPresidentCommented:
Just an FYI. FM treats certain characters as word breaks, so if the number of characters varies, you could just use If [ Leftwords( zipField ; 1 ) = "593" ] it would get everything before the period.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now