BETTWEN in Search Expresions and commas
The problem I have is using BETWEEN operator when customer names have
commas like "NAME, S.A." or "Doe, John", etc.
if no commans in the name(s) like
ppReport1.AutoSearchFields[0].SearchExpression := Doe John,Smith James';
the result is OK:
WHERE ( Reparaciones.NOMBRE BETWEEN "Doe John" AND "Smith James" ):
but if names contains commas
ppReport1.AutoSearchFields[0].SearchExpression := 'Doe, John,Smith, James';
Produces:
WHERE ( Reparaciones.NOMBRE BETWEEN )
How can I tell ReporBuilder that a comma is part of the name and not the
separation of the 2 names ?
Thanks..
Modesto
commas like "NAME, S.A." or "Doe, John", etc.
if no commans in the name(s) like
ppReport1.AutoSearchFields[0].SearchExpression := Doe John,Smith James';
the result is OK:
WHERE ( Reparaciones.NOMBRE BETWEEN "Doe John" AND "Smith James" ):
but if names contains commas
ppReport1.AutoSearchFields[0].SearchExpression := 'Doe, John,Smith, James';
Produces:
WHERE ( Reparaciones.NOMBRE BETWEEN )
How can I tell ReporBuilder that a comma is part of the name and not the
separation of the 2 names ?
Thanks..
Modesto
This discussion has been closed.
Comments
RB 10 internally leverages TStringList.CommaText to parse the items. (Prior
RB versions do not do this, so you might need to update).
For your example, I would try the following
'"Doe, John", "Smith, James'"
From the Delphi help for TStringList.CommatText
"When assigning CommaText, the value is parsed as SDF formatted text. For
SDF format, strings are separated by commas or spaces, and optionally
enclosed in double quotes. Double quote marks that are part of the string
are repeated to distinguish them from the quotes that surround the string.
Spaces and commas that are not contained within double quote marks are
delimiters. "
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com