how to differentiate between entities

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 20-Apr-2006 19:46:44   

hiya,

I have an entity "tblReturnsProduct"

returnId PK barCode PK unitPrice qty

A "ReturnsProduct" is an unsold product that a delivery driver brings back from his delivery round.

Make sense?

Up until now, we didn't have to "classify" the returnProducts.

However, we now have to differentiate between products that are returned because they are either:

1) out of date 2) damaged

What's the best way to do this?

many thanks,

yogi

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 21-Apr-2006 02:23:19   

Well it can be done a few ways. If you want to be able to provide a data driven drop down list then it is easy to setup a table that would be ReturnCode. It could contain tblReturnCodeId and Name. You would then just create a relation between tblReturnProduct and tblReturnCodeId. This is datadriven and lets you add or change the name of a status for all returns easily.

The other simple scenario would be add a varchar that just contains the reason and input your text for the reason there. It's really dependant on whether you will need to expand it later and whether you need to write many queries or use the status in other tables.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 21-Apr-2006 10:07:00   

cheers Brian,

Right, I think that I only need to add a returnCodeId to tblReturnProduct. It sounds quite extendable.

many thanks,

yogi