Subject Re: [firebird-support] Returning Partial field Value
Author Aage Johansen
On Sat, 30 Aug 2003 19:27:50 +0000 (UTC), mbellisle_retire wrote:

> How do I return a partial field value in sql in InterBase?
> ie When I use the mid function in an Access query like this:
> SELECT Mid([SomeField],1,5) AS Expr1
> FROM SomeTable;
> if returns the first 5 characters, starting from the beginning of the
> value, how do I do the same with InterBase?


This is covered in the manual (at least for Fb1.5):
----------------
SUBSTRING( )
Returns a string of specified length from within an input string, starting
from a specified position in the input string.
Syntax SUBSTRING(<input-string> <pos> FOR <length>
----------------

Something like:
select substring(SOMEFIELD 1 for 5)
from SOMETABLE

--
Aage J.