Subject Trouble creating a query using SUBSTR
Author etish2000
I am using TIBOQuery and I need to use a substring of on of the
fields in my query to make the WHERE clause work. However, when I try
to run my application (in Delphi 6) I throw an exception, SQL Error -
804, Function unknown SUBSTR.

My where clause appears as below ...

WHERE
"Transactions"."TransactionTypeID" = '7110' AND
(substr("Transactions"."CrossReference",1,1) = 'A' OR
substr("Transactions"."CrossReference",1,1) = 'V')

I know I can accomplish this with a where clause like this ...

WHERE
"Transactions"."TransactionTypeID" = '7110' AND
("Transactions"."CrossReference" LIKE 'A%' OR
"Transactions"."CrossReference" LIKE 'V%')

but later on I will need to look at substrings that are not just the
first character in the field (allowing me to use LIKE)

Am I going about this the wrong way. Is there a better way to process
this data that I will need for a report?

Please help ...

Thanks,

Eric Tishler