?
Solved

problem with sql query left(colname,length)

Posted on 2006-07-07
2
Medium Priority
?
1,798 Views
Last Modified: 2013-11-24
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?
 
0
Comment
Question by:ICPooreman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Assisted Solution

by:kretzschmar
kretzschmar earned 1000 total points
ID: 17062041
try

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

meikl ;-)
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 1000 total points
ID: 17062077

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

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question