?
Solved

Access 2007 String Function to Find All Text Until Last Period

Posted on 2009-04-29
1
Medium Priority
?
1,706 Views
Last Modified: 2013-11-27
I have a text field called "hierarchy" with values like these below on the left that I'd like to transform into those on the right.  I need a string function that will find the last period (if it has a period) & truncate the last period & remaining digits.  

10 > 10
10.1 > 10
10.1.11 > 10.1
10.1.11.1 > 10.1.11

Can you show me such a function?
0
Comment
Question by:leslieinva
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 24265504

in a query

select [f1], IIF(Instr([F1],".")>0,Left([F1],instrrev([F1],".")-1) ,[F1])
from NameoFTable


change F1 to the  actual name of the field
0

Featured Post

Industry Leaders: 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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

864 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