Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    May 2004
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Duplicate Primary Keys? (2002/SP3)

    I don't understand something I'm seeing. I have a table of items with the column item set as the primary key. I have imported data from a couple of different sources, two Excel spreadsheets and a table from SQL Server. I don't remember when I set item as the primary key but I'm pretty sure I did before importing any data.

    The thing that's got me puzzled is I now see what appears to be duplicate values in the item column. When I looked at this more closely, one value has no trailing spaces but the other does. Here are two examples with quotes added -

    "ITEM1234"
    "ITEM1234

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Duplicate Primary Keys? (2002/SP3)

    Perhaps the spaces are non-breaking spaces. They have ASCII code 160.

    (The Lounge uses HTML to display threads. HTML ignores multiple spaces. You can put <!t>[pre]<!/t> before and <!t>[/pre]<!/t> after text to preserve spacing and indentation)

  3. #3
    Lounger
    Join Date
    May 2004
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duplicate Primary Keys? (2002/SP3)

    Thanks Hans! I would never have figured that out.

    I changed my function to ReplacedItem: Replace([Item],Chr(160),"") and it worked.

    Also, thanks for the tip on the forum.

    Regards,

    Kevin

Posting Permissions

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