{"action":"opened","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/1225","repository_url":"https://api.github.com/repos/tgriesser/knex","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/1225/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/1225/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/1225/events","html_url":"https://github.com/tgriesser/knex/issues/1225","id":136340200,"number":1225,"title":"format of date","user":{"login":"fsebbah","id":2974930,"avatar_url":"https://avatars.githubusercontent.com/u/2974930?v=3","gravatar_id":"","url":"https://api.github.com/users/fsebbah","html_url":"https://github.com/fsebbah","followers_url":"https://api.github.com/users/fsebbah/followers","following_url":"https://api.github.com/users/fsebbah/following{/other_user}","gists_url":"https://api.github.com/users/fsebbah/gists{/gist_id}","starred_url":"https://api.github.com/users/fsebbah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsebbah/subscriptions","organizations_url":"https://api.github.com/users/fsebbah/orgs","repos_url":"https://api.github.com/users/fsebbah/repos","events_url":"https://api.github.com/users/fsebbah/events{/privacy}","received_events_url":"https://api.github.com/users/fsebbah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-25T10:13:04Z","updated_at":"2016-02-25T10:13:04Z","closed_at":null,"body":"Hi,\r\nI have a query with 2 dates at the format \"YYYY-MM-DD\". In the table, the field is stored on the format \"YYYY-MM-DD HH:mm\"\r\nIf I build my query with:\r\n.whereBetween(date,[date1,date2])\r\nknew return 0 rows\r\n\r\nIf I try with:\r\n.whereBetween(date,['%'+date1+'%','%'+date2+'%'])\r\nThe result is the same\r\n\r\nIf I want force the format of the field:\r\n.whereBetween(\"date_format(date,'%Y-%m-%d')\",[date1,date2])\r\nI have an message of error:\r\n_Unhandled rejection Error: select `id`, `employee_id`, `category_id`, `days`, `label`, `date`, `date_end` from `event_view_abs` where `date_format(date,'%Y-%m-%d')` between '2016-02-17' and '2016-02-18' and `parent_id` in (2, 50) and `cb_pointage` = 1 order by `employee_id` asc, `date` asc - Unknown column 'date_format(date,'%Y-%m-%d')' in 'where clause'\r\n_\r\nThanks for your help.\r\nFranck"}}