Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to print the 3 number from the right 1

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
US
I have a report that I need to Highlight, in larger font, and by itself, the third number from the right of a customer order number. Can someone tell me how to parse this number out? for example a number 07/28/11K-3/5. I would need to put the 3 somewhere as a text box or label, independently from the rest of the alpha numeric expression.

Any help is appreciated.
 
I expect you could use a combination of Right() and Left().

Right() takes the rightmost X characters of a string (like 3) and Left() takes the leftmost X characters of a string (like 1). You can nest these to get the character you need.

Please try to work this out. If you have questions, feel free to come back and ask (unless someone feeds you the answer).

Duane
Hook'D on Access
MS Access MVP
 
Can explain it a little bit more. Would I put this expression in a query. For example that number ( 07/28/11K-3/5) is the customer number. Would I query it like ......Truck #: (customer# (Right 93)))?
 
Did you search any Help on the Left() and Right() functions? Click the Help? and enter
Left Function
or
Right Function
or

String Functions

Also, since you have chosen to include # in a field name, you must wrap it in []s.

Hint:
TruckNum: Right([Customer#], /your number here/)



Duane
Hook'D on Access
MS Access MVP
 
I checked it out with the Right function. That gives me three characters from the right, not just the third character only. Do you have information on what would isolate that third character from the right?
 
Thanks that did it......I looked through len, string manipulation and everything wasn't giving me anything to compare with one character without nesting.....Thanks for the help.
 
It looks like there is a MID function in AC just like Excel...is that better or worse than the Left(right(xx,3),1) solution?

Inquiring minds wanted to know...

Ernest

Be Alert, America needs more lerts
 
I just realized that it did nest, but not as convoluted as I would have nested them.... Thanks again.
 
I was hoping MICKI0220 could figure this out with some gentle prodding and prompting.
Duane

Yeah, I knew that, but the teacher in me just wouldn't shut up.
 
thanks Duane...make sense...either way you have to nest something...thanks again...

Ernest

Be Alert, America needs more lerts
 


"the teacher" teaches by GUIDING the learner to discovery, rather than GIVING the answer to the learner.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
"the teacher" teaches by GUIDING the learner to discovery, rather than GIVING the answer to the learner.
Skip

OK, the impatient teacher in me couldn't shut up.

You are correct, I was being an instructor and not a teacher.

Learning took place. In this case the learning process came after the discovery, not before. Not the preferred method when trying to instill desire, but a valid Adult Learning method in the business world. No sense in prolonging the suspense unless you are trying to get students to want to learn by letting them have the 'Aha' moment by themselves, which works well for children and less so for adults. I was assuming the OP was an adult. First shots are free -- those that show a propensity for requiring spoon feeding get less attention.

 
Gammachaser. Learning did take place and I am an adult....Unfortunately I don't have all day and night to spend searching for the knowledge we need to make something work in the workplace, that is why most of us ask for guidance and sometimes a straight answer. After seeing that the result worked, I did realize a different and simpler method of nesting, hence I learned something. Thank you again for the help, and I am sure my user appreciated a quicker result to her quandry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top