Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Apr 2009
Posts: 3
Reputation: marymi is an unknown quantity at this point 
Solved Threads: 0
marymi marymi is offline Offline
Newbie Poster

inventory db

 
0
  #1
Apr 28th, 2009
I'm in the planning stages of an inventory db. The part I can't figure out is how to design the database as far as changing costs go. If I have a cost associated with an item, how do I handle when the cost changes? I know I need to have an effective date with each cost, but all items won't have the costs changing at the same time.

I appreciate any help or suggestions.

Thanks,
Mary
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 118
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster

Re: inventory db

 
0
  #2
Apr 28th, 2009
You should have a seperate table which holds your costs and is referenced to the item table.

Items
--------
id
item_name
Desc
etc.


costs
----------
id
items_id
Costs
effective_date
expiry_date



When you need to update a cost you set the expiry_date for the current record and insert a new record in costs for the items_id. This way you will also have historical data for your changing costs. When referencing the costs you just have to select the active record for the item.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 3
Reputation: marymi is an unknown quantity at this point 
Solved Threads: 0
marymi marymi is offline Offline
Newbie Poster

Re: inventory db

 
0
  #3
Apr 28th, 2009
Thanks. That makes sense, but I'm a little fuzzy about the details. (Let me preface this by saying I'm reasonably experienced with access, but I'm trying to learn filemaker and would rather develop it in filemaker)

How would I call up the correct cost?

Appreciate your help.

Mary
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 118
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster

Re: inventory db

 
0
  #4
Apr 28th, 2009
I have never used filemaker but it is a relational db so their is most likely either a sql window or graphic sql designer like in acccess.

If there isn't you will have to find out how to join tables in filemaker, then join the items table to the costs table where the expiry date is null.

Simple sql

  1. SELECT a.Item_name, b. Costs
  2. FROM items a, costs b
  3. WHERE a.id = b.Item_id
  4. AND b.expiry_date IS NULL

Sorry I couldn't help with the filemaker syntax, there might be someone on here that knows the product.
Last edited by peter_budo; May 6th, 2009 at 3:11 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 3
Reputation: marymi is an unknown quantity at this point 
Solved Threads: 0
marymi marymi is offline Offline
Newbie Poster

Re: inventory db

 
0
  #5
Apr 28th, 2009
Thanks! I didn't think of the is null part!

Regards,
Mary
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC