Hejsa.
Jeg fatter virkelig minus her, kan ikke få denne sql til at virke.
- SELECT from,to, TIMEDIFF(from,to) AS wt FROM work_schedule
Tabellen er som følger
- CREATE TABLE IF NOT EXISTS `work_schedule` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `from` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `to` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `payed` enum('0','1') COLLATE latin1_danish_ci NOT NULL,
- `user_id` int(11) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_danish_ci AUTO_INCREMENT=3 ;