problem with sql query left(colname,length)

I'm trying to use left(colname,length) in a query like below

Select *
From TableName
Where left(colName,6) = '10003-'

I keep getting the error when I try to execute
Invalid use of Keyword
left(colName,6)
I'm using a DBase table with BDE any ideas why I can't execute this query?
 
ICPooremanAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Russell LibbyConnect With a Mentor Software Engineer, Advisory Commented:

You can use the LEFT function (and other SQL92 functions) if you go from BDE->ODBC->MS DBASE driver, but otherwise, as Meikl said, use the LIKE function. Btw, the local SQL is supposed to support SUBSTRING, eg:

SUBSTRING(ColumnName FROM 1 TO 6)

But I couldn't get it to work

Regards,
Russell

0
 
kretzschmarConnect With a Mentor Commented:
try

Select *
From TableName
Where colName like '10003-%'

meikl ;-)
0
All Courses

From novice to tech pro — start learning today.