Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71

    Trailing Spaces workaround

    Is anyone aware of a workaround for the trailing spaces flaw within Access? I need to identify a field that can possibly have a space after the data. Am I better off just doing a comparison in VBA or can this be trouble shooted(shot?(sic))?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What do you mean by flaw?

  3. #3
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    Access is matching data that has a space at the end to data that does not.

    Ex: ABCD_ (where underscore = space) is matching to ABCD.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you considered switching from:
    Option Compare Database to Option Compare Binary?

  5. #5
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    I'm not sure how sort order is driving a match issue. Also, I would hate to inadvertantly affect other queries in the DB that have nothing to do with this action.

    Can you go into more depth as to how this may help with my challenge?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How are you attempting to identify this field that might have a trailing space?

  7. #7
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    I am matching a table of known BudgetWorkbooks to a front end user table. The results are non-match items (see WHERE clause).

    SELECT IT_Staff_Allocation_2010.TemplateOwner, IT_Staff_Allocation_2010.Project, IT_Staff_Allocation_2010.BudgetWorkbook, IT_Staff_Allocation_2010.ResourceName, IT_Staff_Allocation_2010.January, IT_Staff_Allocation_2010.February, IT_Staff_Allocation_2010.March, IT_Staff_Allocation_2010.April, IT_Staff_Allocation_2010.May, IT_Staff_Allocation_2010.June, IT_Staff_Allocation_2010.July, IT_Staff_Allocation_2010.August, IT_Staff_Allocation_2010.September, IT_Staff_Allocation_2010.October, IT_Staff_Allocation_2010.November, IT_Staff_Allocation_2010.December

    FROM IT_Staff_Allocation_2010 LEFT JOIN Budget_Workbook_Allowed ON IT_Staff_Allocation_2010.BudgetWorkbook = Budget_Workbook_Allowed.BudgetWorkbook

    WHERE (((Budget_Workbook_Allowed.BudgetWorkbook) Is Null));

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Something about repeating fields SHOUTS normalization issue to me. I'll look closer and see what you are doing.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So which one of the two tables "might" have a trailing space in the BudgetWorkbook field and would is it supposed to be there and does it mean anything significant? Can you just clean up the field with a [Field] = Trim([Field]) update query? I'm guessing you are not in control of the data input and just have to deal with the results, right?

  10. #10
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    IT_Staff_Allocation_2010 may have the data with spaces. You are correct, I do not control the template that the Front End user has.

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you just linking to the (probably a spreadsheet) or do you import it? How many records are you working with because Access runs much faster on imported tables than linked ones and you could then clean your own copy of the data.

  12. #12
    shexe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    71
    The IT_Staff_Allocation_2010 table is automatically updated through VBA from numerous excel workbooks. The downstream reports are also excel and are updated automatically via data connections. This allows the user to update information on their template (IT_Staff_Allocation_2010) and see results in their BudgetWorkbooks almost same time.

    My concern with the TRIM update is that Access will not be able to handle up to 10 users with an incorporated Update Query. Should I perhaps incorporate the TRIM update in VBA?

  13. #13
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You could probably just incorporate the Trim() function in your SQL. This is just AIR CODE:
    'SELECT TemplateOwner, Project, BudgetWorkbook, ResourceName, _
    January, February , March, April, May, June, _
    July, August , September, October, November, December _
    FROM IT_Staff_Allocation_2010 _
    LEFT JOIN Budget_Workbook_Allowed _
    ON Trim(IT_Staff_Allocation_2010.BudgetWorkbook) = Trim(Budget_Workbook_Allowed.BudgetWorkbook) _
    WHERE (((Trim(Budget_Workbook_Allowed.BudgetWorkbook)) Is Null));

  14. #14
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    she wants the one with space not equal to the one without space.

  15. #15
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So the space must remain and it is significant. Great! That is like significant trailing zero's after the decimal place. Let me think about it for a bit. Is there any *logic* behing that decision?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Checking for trailing letter
    By jgelpi16 in forum Queries
    Replies: 2
    Last Post: 03-23-2010, 09:27 AM
  2. Replies: 3
    Last Post: 01-05-2010, 10:07 PM
  3. Find Spaces in Field
    By stottle in forum Queries
    Replies: 6
    Last Post: 08-17-2009, 02:02 AM
  4. Replies: 9
    Last Post: 07-16-2009, 09:13 PM
  5. Deleting Spaces
    By grgerhard in forum Import/Export Data
    Replies: 2
    Last Post: 04-30-2006, 06:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums