I82Much87
asked on
Regular expressions in Crystal Reports 8.5
I am trying to find all fields that have specific words in them, standing by themselves. The list of words includes
Road
Street
View
Village
I would want
132 Beach Road
to show up (Road)
but not 132 Broadside Lane (Broad != road)
What we have now is something like where field LIKE "*ROAD*" which obviously gets too many hits. I cannot figure out how to do word boundaries in Crystal reports. Please help
I don't think the database it is accessing is SQL, but I'm not positive.
Road
Street
View
Village
I would want
132 Beach Road
to show up (Road)
but not 132 Broadside Lane (Broad != road)
What we have now is something like where field LIKE "*ROAD*" which obviously gets too many hits. I cannot figure out how to do word boundaries in Crystal reports. Please help
I don't think the database it is accessing is SQL, but I'm not positive.
Put spaces around the word
You could do it as
if {tblStudentAddress.ADDRESS _1} like ["* Alley *", "Alley *", "* Alley", "* Apartment *","Apartment *","* Apartment","* Avenue *","Avenue *","* Avenue"] then "Y"
That should cover Alley, Apartment and Avenue at the start, middle and end
mlmcc
You could do it as
if {tblStudentAddress.ADDRESS
That should cover Alley, Apartment and Avenue at the start, middle and end
mlmcc
ASKER
Yes that would work if it's in the middle of the sentence. But it would not work for Road at the end of a line, for instance. Similarly there are some of the words that will be the first word in the line, so they would not have a leading space
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think this will work. You didn't mention how to get the word Road in the middle of the line by itself, but I think if we modify your pattern and say "* Road *" that will work.
Thanks!
Thanks!
ASKER
is how the code is currently structured