Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

USING SQL  IN VB6 WITH PERVASIVE SQL 2000

Posted on 2009-04-23
1
Medium Priority
?
625 Views
Last Modified: 2013-12-25
I have a key wich could look like:
"07PLVEL       SL4             54.1300   "
if I use SELECT * FROM "OMZETTEN" WHERE LEFT(KEY_2,7)='07PLVEL'  works fine
but how to call if I want only keys  like:
SELECT * FROM "OMZETTEN" WHERE LEFT(KEY_2,7)='07PLVEL'  and  mid(key_2,15,3)   = 'SL4'   this will give error
or
SELECT * FROM "OMZETTEN" WHERE mid(KEY_2,3,5)='07PLVEL'  and  mid(key_2,15,3)   = 'SL4'   this will give error
0
Comment
Question by:BIAPRO
1 Comment
 
LVL 18

Accepted Solution

by:
mirtheil earned 2000 total points
ID: 24213757
What error?  
There is no MID function in PSQL 2000i. You need to use the SUBSTRING function:
SUBSTRING (string1, start, length) - Returns a character string derived from
string1 beginning at the character position specified by start for length characters.

So, your query should be:
SELECT * FROM "OMZETTEN" WHERE LEFT(KEY_2,7)='07PLVEL'  and  SUBSTRING(key_2,15,3)   = 'SL4'  
and
SELECT * FROM "OMZETTEN" WHERE SUBSTRING(KEY_2,3,5)='07PLVEL'  and  SUBSTRING(key_2,15,3)   = 'SL4'
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

810 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