Search code examples
ms-access

MS Access Query Select Numbers after a period in a query


I know this is simple, however, I cannot find the solution and there are so many SQL examples. I want a simple query builder solution.

Currently trying

NameofNewField:Left([PullingBaseDataField],-2)

-2 doesn't work. Data is simple - example below.
S.0001
S.0002


Solution

  • Consistency in data structure is critical when manipulating strings.

    If there will always be "S." followed by digits:

    Replace([PullingBaseDataField], "S.", "")

    Or

    Mid([PullingBaseDataField], 3)

    Otherwise, if there can be more alpha but always a period:
    MID([PullingBaseDataField], InStr([PullingBaseDataField], ".") + 1)