I'm trying to query the recent week rows by using dates. BUT the query is not returning any result. It takes forever to execute.
I checked my DataBase where date is saved in 1446976737
format which seems unix timestamp. BUT in my filters user is entering human readable dates such as 2018-11-11
. Now by executing the below query i'm not getting result. Is there anything wrong with my query?
SELECT `e`.`id` AS `id`, `e`.`first_name` AS `first_name`,
`e`.`gender` AS `gender`,
`e`.`email` AS `email`, `e`.`phone` AS `phone`, `e`.`age` AS `age`,
`e`.`version` AS `version`, `e`.`evaluation_status` AS `evaluation_status`,
`e`.`ip_address` AS `ip_address`, `e`.`date_created` AS `date_created`,
`e`.`date_updated` AS `date_updated`
FROM `evaluation_client` AS `e`
WHERE
AND `e`.`date_created` >= 2018-11-11
AND `e`.`date_created` <= 2018-11-18;
From the answers and comment i also tried the below query but still it's taking 3 minutes to load the data is it normal? How can i make it faster?
SELECT `e`.`id` AS `id`, `e`.`first_name` AS `first_name`,
`e`.`gender` AS `gender`,
`e`.`email` AS `email`, `e`.`phone` AS `phone`, `e`.`age` AS `age`,
`e`.`version` AS `version`, `e`.`evaluation_status` AS `evaluation_status`,
`e`.`ip_address` AS `ip_address`, `e`.`date_created` AS `date_created`,
`e`.`date_updated` AS `date_updated`
FROM `evaluation_client` AS `e`
WHERE
`e`.`date_created` >= unix_timestamp("2015-11-11")
AND `e`.`date_created` <= unix_timestamp("2015-11-19")
ORDER BY
`e`.`date_created` DESC;
date_created
???int
SHOW CREATE TABLE evaluation_client
.