How to format to display only part of a number?

B

Bob T

I use a program that merges to Word 2000. One field that I merge is a court case number that in the program is in the following format "NN-NNNNN" or sometimes "NN-NNNNN-9P7". The first two numbers are the year and the next five numbers are the case number. I need to merge the case number into a document, but only display the middle five numbers. Can this be done? Thanks for any help you can give.
 
D

Doug Robbins - Word MVP

Hi Bob,

What is the data source? It's probably going to be easier to do the
necessary manipulation there.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
B

Bob T

The data is contained in a third-party case management software. I suspect that I might be able to request an enhancement to the program, but historically that has occurred quickly. I've been looking around and came across use of the SET command, and it seemed like that might work, but I didn't have enough knowledge to know for sure.
 
D

Dreamboat

Until they can implement that change, perhaps you can dump the data out into Excel, and add the extra column to get the value you want. Use =mid(d1,4,5

<-*-><-*-><-*-><-*-><-*-><-*-><-*-><-*-
Hope this helps
Anne Tro
Author: Dreamboat on Wor
Email: Dreamboat*at*Piersontech.co
Web: www.TheOfficeExperts.com
 
M

macropod

Hi Bob,

You can do this with strictly numeric strings, but not with alpha-numeric
strings, so "NN-NNNNN" or "NN-NNNNN-NN" will work, but not "NN-NNNNN-9P7".
See the following field for an example of how to code such a field:
{QUOTE{SET ID "12-34567-890"}{SET EXP1{=-{=-{ID}-ID}/2}}{SET
EXP2{=-({ID}*(-1)-{ID})/2}}{SET
EXP3{=-({EXP1}+{EXP2}-{ID})}}{=IF({EXP2}=0,{EXP3 \# 00000},{EXP2 \#
00000})}}
You'll get the same output with this field regardless of whether there is a
third (numeric) string in the sequence.

Cheers
PS: The field braces '{}' are input in pairs using Ctrl-F9, and the numeric
picture switches for EXP2 and EXP3 are to preserve leading 0s.

I use a program that merges to Word 2000. One field that I merge is a
court case number that in the program is in the following format "NN-NNNNN"
or sometimes "NN-NNNNN-9P7". The first two numbers are the year and the
next five numbers are the case number. I need to merge the case number
into a document, but only display the middle five numbers. Can this be
done? Thanks for any help you can give.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top