The question is about one kind of order traking system. There is orders and states for these. UI is created using PHP and the whole system is currently working as excepted. Now I would like to add some extra stuff into system. One possibility what i've been thinking is statistics, like how long it usually takes for goods to come from factory and so on.
Tables are in MySQL. Here is a dump from my table creation script.
CREATE TABLE orders(
order_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
target varchar(50) NOT NULL,
status_id TINYINT UNSIGNED NOT NULL default 1,
deliv_type_id TINYINT UNSIGNED NOT NULL default 1,
ord_type_id TINYINT UNSIGNED NOT NULL default 1,
reference varchar(20) default NULL,
order_time TIMESTAMP,
order_handler_id TINYINT UNSIGNED default NULL,
arrived DATETIME default NULL,
arrived_handler_id TINYINT UNSIGNED default NULL,
delivery_time DATETIME default NULL,
delivery_handler_id TINYINT UNSIGNED default NULL,
explnation text default NULL,
superfast_order BOOL default FALSE,
contact_name varchar(25) default NULL,
phone varchar(15) default NULL,
email varchar(25) default NULL
) TYPE=MyISAM;
I have these kind of records no more than 5000 in DB.
What i want to do is count average times from order to arrive, from order to delivery but i don't want to count saturdays or sundays ...
Thanks and cheers