尝试运行将在特定日期之后返回所有数据的查询。日期设置为varchar而不是日期。
我有:
SELECT employee_id, emp_firstname, emp_lastname, custom79 AS 'First Pay Date', custom6 AS 'Agency', custom56 AS 'Country of Homebase'
FROM `hs_hr_employee`
WHERE custom6 LIKE 'Brookfield'
AND custom61 LIKE 'active-oam'
AND custom79 > '13-07-2012'
帮助会很棒,因为我不确定如何将查询转换为日期
使用UNIX,phpmyadmin,sql
答案 0 :(得分:0)
试试这样:
SELECT employee_id, emp_firstname, emp_lastname, custom79 AS 'First Pay Date', custom6 AS 'Agency', custom56 AS 'Country of Homebase'
FROM `hs_hr_employee`
WHERE custom6 LIKE 'Brookfield'
AND custom61 LIKE 'active-oam'
AND STR_TO_DATE(custom79, '%d-%m-%Y') > '2012-07-13'