How exactly could you use a data grid as filter?
I want to filter the below table with the following sql:
SELECT * FROM
(
SELECT
access_id,
access_db,
access_company,
access_br,
access_desc,
access_pc,
access_mac,
access_data,
DATE_ADD(access_last, INTERVAL 8 HOUR) access_time,
TIMEDIFF(NOW(),access_last) time_diff,
DATE_ADD(NOW(), INTERVAL 8 HOUR) time_now,
access_last,
access_enabled,
access_live,
access_new,
access_error_time,
access_error_last,
access_note
FROM
tbl_access_pc
WHERE
access_db<>5 and
access_db<>-1
ORDER BY access_last DESC) tmp
GROUP BY access_db,access_br
HAVING access_last < DATE_SUB(NOW(),INTERVAL 20 MINUTE)
Can you share an example?
The structure of "tbl_access_pc" table.
;
;
;
;
CREATE DATABASE IF NOT EXISTS `database_config` ;
USE `database_config`;
CREATE TABLE IF NOT EXISTS `tbl_access_pc` (
`access_id` int(11) NOT NULL AUTO_INCREMENT,
`access_db` int(11) NOT NULL DEFAULT '0',
`access_company` varchar(100) DEFAULT '',
`access_br` int(11) NOT NULL DEFAULT '0',
`access_desc` varchar(100) DEFAULT '',
`access_pc` varchar(100) DEFAULT '',
`access_mac` varchar(100) NOT NULL DEFAULT '',
`access_data` varchar(100) NOT NULL DEFAULT '',
`access_last` datetime DEFAULT NULL,
`access_enabled` tinyint(1) DEFAULT '0',
`access_live` tinyint(1) DEFAULT '0',
`access_new` tinyint(1) DEFAULT '1',
`access_error_time` datetime DEFAULT NULL,
`access_error_last` varchar(255) DEFAULT NULL,
`access_note` varchar(255) DEFAULT NULL,
`access_version` varchar(10) DEFAULT NULL,
PRIMARY KEY (`access_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
;
;
;