Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    22

    Unhappy Unanswered: Single Field Duplication Problem

    I have a table with many fields but there is a single field that I do not want duplicates. If I index this specific field preventing duplicates, the entire record does not append. (The field in question is not keyed).


    Thanks

    Bill Howard

  2. #2
    Join Date
    Mar 2004
    Posts
    25

    Re: Single Field Duplication Problem

    Originally posted by whoward
    I have a table with many fields but there is a single field that I do not want duplicates. If I index this specific field preventing duplicates, the entire record does not append. (The field in question is not keyed).

    If you want the record to be added to the table anyway, what do you want to happen to the field with the duplicate value?

  3. #3
    Join Date
    Jan 2003
    Posts
    22
    Hi and thanks for the reply. Ideally, the record would be unaffected except for the specific field (the one(s) that are duplicaes), which can remain blank.

    Thanks,

    Bill

  4. #4
    Join Date
    Mar 2004
    Posts
    25
    Originally posted by whoward
    Hi and thanks for the reply. Ideally, the record would be unaffected except for the specific field (the one(s) that are duplicaes), which can remain blank.

    Thanks,

    Bill
    There's probably a way better way of doing this than what I'm about to propose - but it's Thursday afternoon (in my time-zone anyway! ) and this is all I can think of...

    Write your insert as a union all, with the first half of the union selecting all the fields, where the value doesn't exist on the table and the second half selecting null for the duplicate field and all the other fields, where the value does exist on the table.

    I have to say, this strikes me as a really dubious thing to want to do to your data, but hey - it's your data...

  5. #5
    Join Date
    Jan 2003
    Posts
    22
    Hi,

    Maybe the 'why' of this will be useful.
    My staff use PDAs to capture clinical data. Records in their PDA are duplicted for subsequent patient visits to avoid the need to re-enter all of their data, soem of it demographic.
    Unfortunately, medication treatment times are also duplicated with this process. Unless my staff they edit out these times, the field duplicates when the PDA is synced to the computer's database. This would mis-represent the number of treatments actually performed.
    I am trying to cleanup the PCs DB by not having these duplicates in this 1 specific field. The other fields that duplicate are fine.

    Thanks again,

    Bill Howard

Posting Permissions

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