LEFT() problems

I need to get the right end of a field. Really what i want is
everything after 7 characters in.

so if the field is 123456789
i would return 89

I can't use right([field]) since i don't know how many characters the
field will be.

any help

tia,
KO
Turtle [ Mi, 02 April 2008 02:16 ] [ ID #1933834 ]

Re: LEFT() problems

turtle <kolsby [at] vistacontrols.com> wrote in news:f722ab6f-ae0e-4d07-85dd-
68395e4c5a34 [at] u69g2000hse.googlegroups.com:

> so if the field is 123456789
> i would return 89

Mid$("123456789", 8)
Lyle Fairfield [ Mi, 02 April 2008 03:10 ] [ ID #1933838 ]

Re: LEFT() problems

You can use the Len function to return the length of the original string,
subtract 7 from it, and use that as the length field of a Right command, but
Lyle's approach is simpler, and likely faster (though any code execution is
likely to be so much faster than disk operations that shaving a few
nanoseconds or microseconds isn't going to make a visible difference to the
user watching the screen.

Larry Linson
Microsoft Office Access MVP

"turtle" <kolsby [at] vistacontrols.com> wrote in message
news:f722ab6f-ae0e-4d07-85dd-68395e4c5a34 [at] u69g2000hse.google groups.com...
>I need to get the right end of a field. Really what i want is
> everything after 7 characters in.
>
> so if the field is 123456789
> i would return 89
>
> I can't use right([field]) since i don't know how many characters the
> field will be.
>
> any help
>
> tia,
> KO
Larry Linson [ Mi, 02 April 2008 04:40 ] [ ID #1933842 ]

Re: LEFT() problems

turtle wrote:
> I need to get the right end of a field. Really what i want is
> everything after 7 characters in.
>
> so if the field is 123456789
> i would return 89

SELECT Mid(Field,8) as Remainder
FROM Table


> I can't use right([field]) since i don't know how many characters the
> field will be.
>
> any help
>
> tia,
> KO
DFS [ Mi, 02 April 2008 06:13 ] [ ID #1933844 ]
Datenbanken » comp.databases.ms-access » LEFT() problems

Vorheriges Thema: Make an array of toggle buttons
Nächstes Thema: Maintain select record in multiple subforms