Subject Re: [firebird-support] FB/IB equivalent of LEFT(string, count)
Author moscow@cix.co.uk
Thanks for the reply, Helen - see below:

----------Original Message---------

> At 11:18 AM 13/12/2003 +0000, you wrote:
> >I'm new to FB, and my old SQL knowledge seems to have deserted me here.
> >
> >Using 'LEFT(field_name, count)' in a WHERE clause of a query gets me a
> >'TOKEN unknown' error.
> >
> >I thought this was standard SQL, but evidently FireBird has other
> ideas.
>
> Standard SQL for what? The LEFT keyword in SQL is reserved. It's used
> in LEFT OUTER JOIN.

I realise it's a reserved word, that much I knew. It is where/how it can
be used that seems to be in conflict with other SQL usage. However, in
SQLServer, Access, FoxPro (prior to MS), the use of:

SELECT field1, field2 FROM Table
WHERE LEFT(field3,3) = 'foo'

has always worked in the past - but apparently not in FB1.5.

so has:

SELECT LEFT(field1,3) AS foobar
FROM Table

I'm in the process of converting a ColdFusion web app from using Access
mdbs to FB1.5, hence the problem.


>
>
> >Can someone tell me the equivalent, please?
>
> What does this function need to do?

As either of the cases above!


Cheers
Terry