From: Michaelcip on
Thanks guys. I was able to figure it out via parsing. But this "Replace"
method was interesting alternative that I'll tuck away for future use. Have
a great one, MC

"Marshall Barton" wrote:

> Michaelcip wrote:
> >I'm trying to parse the following field (Machine) to eliminate the "-SAP"
> >How is this done? Many thanks, MC
> >
> >Machine
> >DT-1-SAP
> >EC-1600-SAP
> >EC-1600-SAP
> >EC-1600-SAP
> >EC-1600-SAP
> >EC-1600-SAP
> >EC-1600YZT-SAP
> >EC-2000-SAP
>
>
> If the -SAP is guaranteed to always be there:
>
> Left(Machine, Len(Machine) - 4)
>
> But if it might not be there in some records and the field
> might be Null sometimes, it can get messy:
>
> IIf(Machine Is Null, Null, IIf(Machine Like "*-SAP",
> Left(Machine, Len(Machine) - 4), Machine)
>
> --
> Marsh
> MVP [MS Access]
> .
>