Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

future product costs Expand / Collapse
Author
Message
Posted Tuesday, October 22, 2013 2:32 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 1, 2014 1:15 PM
Points: 117, Visits: 413
Hi

i am developing a small db which has the following requirement...

A product cost can be created for a future year/month. All transaction before that date use the current cost. All transaction after that date will use the new cost.

If i have my product table with a cost field in how do i create a table that uses the above rule? i.e. the cost will change based on future cost changes.

hope that makes sense.

Thanks
Post #1507013
Posted Monday, October 28, 2013 4:29 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, April 1, 2014 6:12 PM
Points: 827, Visits: 342
A typical Price Master table would look like the one below:

Product ID--------Price------From Date-------To Date
P001-------------100-------1/1/2013---------12/31/2013
P001-------------150-------1/1/2014---------12/31/2014
P001-------------175-------1/1/2015---------

Your logic would pick up the Price based on the current date residing between From Date and To Date.


  Post Attachments 
PriceMaster.png (0 views, 2.22 KB)
Post #1509139
Posted Monday, October 28, 2013 4:36 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, April 1, 2014 6:12 PM
Points: 827, Visits: 342
So with the current table you need to have two more columns From Date and To Date.

Else have a new table as Price Master as detailed above.

Let me know if this meets your requirements.
Post #1509140
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse