PC Review


Reply
Thread Tools Rate Thread

Avoiding duplicate fields in a table

 
 
PVANS
Guest
Posts: n/a
 
      13th Jan 2010
Good morning

Please can someone help me with this:

I have a table tblCommission which has the following fields:
Commission_ID (primary key)
Client_account (related to the field Client_account in tblClients)
Product_Code (related to the field Product_Code in tblProducts)
Commission
Exchange

I need a method to ensure that each client can only have one commission per
product.... all clients should (and do) have the ability to have a commission
for all the possible products, but I need to protect my database from the
scenario I have shown below:

Commission_ID Client_account Product_code Commission Exchange
1 000001 Coke 2
$
2 000001 Coke 1
$

Please could someone suggest a method to protect the table from this
scenario occuring?

Thank you for the help, I really appreciate it.
 
Reply With Quote
 
 
 
 
Piet Linden
Guest
Posts: n/a
 
      13th Jan 2010
On Jan 13, 8:15*am, PVANS <PV...@discussions.microsoft.com> wrote:
> Good morning
>
> Please can someone help me with this:
>
> I have a table tblCommission which has the following fields:
> Commission_ID (primary key)
> Client_account (related to the field Client_account in tblClients)
> Product_Code (related to the field Product_Code in tblProducts)
> Commission
> Exchange
>
> I need a method to ensure that each client can only have one commission per
> product.... all clients should (and do) have the ability to have a commission
> for all the possible products, but I need to protect my database from the
> scenario I have shown below:
>
> Commission_ID * Client_account *Product_code * Commission * Exchange
> 1 * * * * * * * * * * * * * * * * 000001 * * * * * * *Coke * * * * * * * * 2
> * * * * * * * * *$
> 2 * * * * * * * * * * * * * * * * 000001 * * * * * * *Coke * * * * * * * * 1
> * * * * * * * * *$
>
> Please could someone suggest a method to protect the table from this
> scenario occuring?
>
> Thank you for the help, I really appreciate it.


Add a unique index to (Client_account, Product_code) and you will not
be able to enter duplicates *ever*, so if this is a "sometimes" rule
instead of an "always" rule, you'll have to rethink your strategy.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
duplicate fields on table Ruben Microsoft Access Database Table Design 1 16th Jun 2009 12:00 AM
Table design question re duplicate fields lmcc007 Microsoft Access Database Table Design 4 8th May 2009 06:16 PM
table: using multiple fields to define a duplicate Nick M Microsoft Access 3 8th Sep 2007 06:02 PM
Preventing Duplicate Fields in a Junction Table Dave White Microsoft Access Forms 3 26th Feb 2007 01:06 PM
Duplicate Fields in Table design Troy Microsoft Access Database Table Design 1 24th Feb 2004 12:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:07 PM.