Solved

problem with sql query left(colname,length)

Posted on 2006-07-07
2
1,792 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
2 Comments
 
LVL 27

Assisted Solution

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

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

meikl ;-)
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 250 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
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 …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now