picnichouse Posted February 1, 2005 Posted February 1, 2005 Hi, I need to do a calculation that compares two fields, and if the contents of one field are included in the other field it performs an action on them. I only know how to say if A = B exactly, not if A is part of B. What command do I use to represent a wildcard, like if A = *B*? Thanks! Andrew
Fitch Posted February 1, 2005 Posted February 1, 2005 The PatternCount() or Position() function will do this. E.g.: Position( B ; A ; 1 ; 1 ) This means, "look in field B for the text A, starting at the first character, where is A." Position(text;searchString;start;occurrence) So any non-zero result will evaluate as true. Using Position should evaluate faster than PatternCount in theory, since it can stop evaluating after the first occurrence, whereas PatternCount has to scan the entire text.
Recommended Posts
This topic is 7238 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 accountSign in
Already have an account? Sign in here.
Sign In Now