LEFT() problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • turtle

    #1

    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
  • lyle fairfield

    #2
    Re: LEFT() problems

    turtle <kolsby@vistaco ntrols.comwrote in news:f722ab6f-ae0e-4d07-85dd-
    68395e4c5a34@u6 9g2000hse.googl egroups.com:
    so if the field is 123456789
    i would return 89
    Mid$("123456789 ", 8)

    Comment

    • Larry Linson

      #3
      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@vistaco ntrols.comwrote in message
      news:f722ab6f-ae0e-4d07-85dd-68395e4c5a34@u6 9g2000hse.googl egroups.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

      Comment

      • DFS

        #4
        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

        Comment

        Working...