Solved

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

Posted on 2014-10-20
2
204 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

Suggested Solutions

This article describes some very basic things about SQL Server filegroups.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 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