Access 2007 String Function to Find All Text Until Last Period

Posted on 2009-04-29
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

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

    Accepted Solution


    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now