Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    extracting data from the middle of a value

    I am trying to extract the 04 from the value 20110402A in a query. The field is called AptID. I only want the value in the 04 place holder to display for all records. I know you can use Left$ and Right$ to trim data but i have never tried to extract a value in the middle. Any suggestions? Thanks...

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    If the bit you want is always in positions 5 and 6, you can use the Mid function.
    MonthNumber: Mid([AptID],5,2)
    Extract 2 characters starting at the fifth character, from APTID.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •