Crystal Report Syntax for "include"

gixxer1020 used Ask the Experts™
I have the following code but and on line 2 instead of looking for just "overbooked", I need any data that includes the word overbooked.

Date({Reservation.InDate}) in {?Date} and
{Room.RoomNumber}  "overbooked" and
(IF {?Site} = 0 THEN TRUE ELSE {Reservation.SiteID} = {?Site}) and
{Reservation.ReservationStatus} in ["Pending"]


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I don't know which field might contain 'overbooked' but the syntax you want is...

and instr({Table field},  "overbooked") >0  and
In addition to InStr, you could also use

"overbooked" in {Room.RoomNumber}

  -- or --

{Room.RoomNumber} like "*overbooked*"

 Note that all of these tests are just string comparisons and are not looking for "words".  They will be true if the field contains that group of characters.  But with something like "overbooked", that may not be a problem.  If you were looking for "booked", then a test like ("booked" in {field}) would match fields that contained "booked", "overbooked", "underbooked", etc.

FWIW, I think Peter's post deserves at least some of the points, since it's a valid solution.  I was just providing some alternatives.  You can ask to have the question re-opened and split the points between us, if you like.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial