Results 1 to 3 of 3

Thread: Access Query

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    Access Query

    Quick question, I have a table in access where I need to verify if a certain field contains 12 characters, and if it does, cut off the last 4 characters. What would be the best way of doing this using an Access Form?

    I tried doing a recordset thing but I'm not sure how to connect to the local provider instead of specifing the file name again.

    So this has to be in access, I can't use VB6 for this one (long story)
    NXSupport - Your one-stop source for computer help

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Code:
    select iif(len([table].[field])>11,left([table].[field],len([table].[field])-4,[table].[field]) as TrimmedField
    From table
    Something like that? This is in the query, but you could put it into code if you need to.
    iif - instant if
    len - length of field
    left - left side of field



    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    Thanks a bunch, thats exactly what I was looking for!
    NXSupport - Your one-stop source for computer help

Posting Permissions

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



Click Here to Expand Forum to Full Width