Well, yeah, sure...<slapping forehead>...Brilliant!
Thanks Ted. Mike Copeland Ted Roche wrote:
Or you could just use the LIKE keyword: https://support.microsoft.com/en-us/kb/98434 On Sat, Aug 22, 2015 at 4:08 PM, Mike Copeland <[email protected]> wrote:Having a bad brain day... Using MYSQL, it's easy to get a string match using [field like "%1234"] to find all strings ending with 1234, or [field like "1234%"] for all strings beginning with 1234, and they can be combined with [field like "%1234%"] for embedded. Is the closest thing in VFP9sp2 the "like()" function? I'm wanting something for use in an SQL statement that doesn't make VFP turn to sludge. Currently I'm requiring that the match string (1234) is always 4 characters and it works using match = '1234' SELECT field FROM .... WHERE ALLTRIM(field)=RIGHT(ALLTRIM(match),4) What I would like is something like match ='1234B' SELECT field FROM .... WHERE field LIKE '%'+match That would allow match to be any length. Is this the answer? SELECT field FROM ... WHERE like('*'+match,field) Is that the fastest performing SQL way to do this in VFP9? The "field" is a 20 character string field, space padded, and match will always be a alphanumeric string. Thanks for any tips! Mike Copeland
[excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

