Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2002
    Location
    London
    Posts
    73

    Unanswered: Query taken away "-"

    Hi i'm just wondering on a query i have a field called sort code and i am trying to take away the "-"

    Eg 60-60-50 I want it to be 606050. Is there an easy way to do this is a query as i have over 500 records.

    Thanks

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    How about the Replace?

    Replace(FieldName,"-","")

    HTH,
    Sam

  3. #3
    Join Date
    Jan 2002
    Location
    London
    Posts
    73
    Hi the replace function does not seem to work in Access 2000. Do you have any other ideas please?

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You can also try the format function (ie XX: Format([MyField],"000000")

    If that doesn't work and if there's always the same number of digits, you can try something a little more complex:

    XX: left([MyField],2) & mid([MyField],3,2) & right([MyField],2)
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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