Solved

VFP 9 Insert a "-" after the 3rd Char

Posted on 2014-10-20
2
206 Views
Last Modified: 2014-10-20
We are using VFP 9 and I would like to add a "-" after the 3rd Char
eg

hold
1185264
1259632
4582565

change to

hold
118-5264
125-9632
458-2565

Thanks
0
Comment
Question by:RVL
[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 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 40392414
You should be able to use SUBSTR() function - something like:

SUBSTR(1185264, 1,3)+'-'+SUBSTR(1185264,4,4)


http://msdn.microsoft.com/en-us/library/5464bfxy(v=vs.80).aspx
0
 
LVL 32

Expert Comment

by:awking00
ID: 40392537
Note - if there can be fewer or a greater number of characters than four after the third character, just elminate the last parameter of the substr function which defaults to the end of the string -
SUBSTR(yourfield, 1,3) + '-' + SUBSTR(yourfield,4)
No points, please.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

695 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