Solved

problem with sql query left(colname,length)

Posted on 2006-07-07
2
1,790 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
This collection of functions covers all the normal rounding methods of just about any numeric value.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…

743 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

10 Experts available now in Live!

Get 1:1 Help Now