1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Access update query formula

Discussion in 'Business Applications' started by roblong, Jan 13, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. roblong

    roblong Thread Starter

    Joined:
    Oct 17, 2008
    Messages:
    33
    Hi,

    I have a table with a text field (call it "NbrCounter") that holds data in the following format:

    Number1
    Number2
    .
    .
    Number15
    .
    .
    Number124
    .
    etc...

    I'm wondering if there is a way to write an update query that would strip off the numbers on the right and put them into a new number column.

    In Excel I would simply write a function like =RIGHT(E6,LEN(E6)-6) which would strip off 6 characters starting from the left, leaving just the numbers. Is there anything similar I can do in Access?

    Thanks
     
  2. etaf

    etaf Moderator

    Joined:
    Oct 2, 2003
    Messages:
    65,252
    First Name:
    Wayne
    still have those functions and MID

    mid = http://www.techonthenet.com/access/functions/string/mid.php
    left = http://www.techonthenet.com/access/functions/string/left.php
    right = http://www.techonthenet.com/access/functions/string/right.php
    length = http://www.techonthenet.com/access/functions/string/len.php

    so you should be able to do something the same
    something like - dont have access in front of me

    =mid([nbrcounter],7,len[nbrcounter]-6
    so this should start at character 7 (the 1st part of the number and then take 6 away from the length of the string and so extract the number

    sorry its not the exact syntax
     
  3. roblong

    roblong Thread Starter

    Joined:
    Oct 17, 2008
    Messages:
    33
    Thanks, etaf!

    Using the "mid" function worked like a charm.

    Best,

    Robert
     
  4. etaf

    etaf Moderator

    Joined:
    Oct 2, 2003
    Messages:
    65,252
    First Name:
    Wayne
    excellent - sorry i could type exact syntax - but glad it worked all ok
    (y)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/974496

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice