The main question is
What is best filed type that i can use in table “product_price” ?
Datetime
Timestamp
Or ...
And which format is best for it ?
I have 3 table
1 ) group -----> (group_id,group_name)
2 ) product --->(group_id,product_id,product_name)
3 ) product_price ----> (product_id,price_id,price_value,price_date)
Note : maybe in one day multi records saved . so time must save in date format ,too.
What is best filed(s) for Date in table “product_price” ?
I want to display any charts based on date from my database
(for example see
http://www.kitco.com/charts/livegold.html[
^])
I want that i can get different between first and last record(based on date field) from table “product_price” And then generate available date that user can see chart .
Example1)
Suppose different between first and last record is 35 days , in this case available chart is :
Today
Yesterday
Last week
Last month
Note : Last 3 month not available
Example2 )
Suppose different between first and last record is 253 days , in this case available chart is :
Today
Yesterday
Last week
Last month
Last 3 month
Last 6 month
Note : Last year not available
Example3 )
Suppose different between first and last record is 900 days , in this case available chart is :
Today
Yesterday
Last week
Last month
Last 3 month
Last 6 month
Last year
Last 2 year
Note : Last 3 year not available
And Finaly I say Again : The main question
What is best filed type that i can use in table “product_price” ?
Datetime
Timestamp
Or ...
And which format is best for it ?