[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

problem with sql query left(colname,length)

Posted on 2006-07-07
2
Medium Priority
?
1,802 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

868 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