Board index » delphi » Invalid use of keyword: left(ae,2)

Invalid use of keyword: left(ae,2)

  My database (Ingres) has an SQL string function called left(s1,len).
When I use it in Delphi 3 I get the error message: Invalid use of
keyword: left(ae,2).  Is there a way I can still use the left string
function?  Does Delphi have an easy way to do this?

Joseph Jelonek
GOG (Gynecological Oncology Group) Statistical Office
Roswell Park Cancer Institute
jelo...@gogstats.med.buffalo.edu

 

Re:Invalid use of keyword: left(ae,2)


Quote
Jelonek, Joe wrote in message

<5A472C6AE040D111A5B900A0C989CAB2134...@gog3.med.buffalo.edu>...

Quote
>  My database (Ingres) has an SQL string function called left(s1,len).
>When I use it in Delphi 3 I get the error message: Invalid use of
>keyword: left(ae,2).  Is there a way I can still use the left string
>function?  Does Delphi have an easy way to do this?

You don't say which database you are using.  Local SQL is somewhat limited
on available functions so if you are using Dbase or Paradox then you need to
get up to speed on the functions that are available to use in SWL
statements.  If you are using another SQL databas like MSSQL or Interbase
then the available functions are going to be whatever is supported by that
database.   If you are using a SQL database then it sounds like the function
you are looking for is SUBSTR(S1, I N)  where s1 is the original string, i =
to the starting point and N is the number of characters to show.

I do not recall if this is supported in local SQL or not.  If you are using
DBase you can set a filter to do the same thing which would be LEFT(field,
N) .

David Farrell-Garcia
Orca Software

Other Threads