{"action":"created","issue":{"url":"https://api.github.com/repos/getredash/redash/issues/1340","repository_url":"https://api.github.com/repos/getredash/redash","labels_url":"https://api.github.com/repos/getredash/redash/issues/1340/labels{/name}","comments_url":"https://api.github.com/repos/getredash/redash/issues/1340/comments","events_url":"https://api.github.com/repos/getredash/redash/issues/1340/events","html_url":"https://github.com/getredash/redash/issues/1340","id":182444830,"number":1340,"title":"date type parameters were calculated when it","user":{"login":"idalin","id":3346204,"avatar_url":"https://avatars.githubusercontent.com/u/3346204?v=3","gravatar_id":"","url":"https://api.github.com/users/idalin","html_url":"https://github.com/idalin","followers_url":"https://api.github.com/users/idalin/followers","following_url":"https://api.github.com/users/idalin/following{/other_user}","gists_url":"https://api.github.com/users/idalin/gists{/gist_id}","starred_url":"https://api.github.com/users/idalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idalin/subscriptions","organizations_url":"https://api.github.com/users/idalin/orgs","repos_url":"https://api.github.com/users/idalin/repos","events_url":"https://api.github.com/users/idalin/events{/privacy}","received_events_url":"https://api.github.com/users/idalin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T06:22:47Z","updated_at":"2016-10-12T06:34:12Z","closed_at":null,"body":"### Issue Summary\r\n\r\nMysql query. when I tried to compare a datetime field with a date type parameter, it failed because the parameter was calculated.\r\n\r\n### Steps to Reproduce\r\n\r\n1. select a mysql datasource\r\n2.   try this sql\r\n`select date(datetime_field), {{start_date}},{{end_date}} from mytable `\r\n3. set the start_date and end_date type to date.\r\n4. set the start_date to 2016-10-06 and end_date to 2016-10-10\r\n5. get the result like this:\r\n\r\n> DATE(CREATETIME)\t2016-10-06\t2016-10-10\r\n04/01/16\t2,000\t1,996\r\n\r\n\r\n6. what i really want is \r\n`select count(0), date(datetime_field) from mytable where date(datetime_field) between {{start_date}} and {{end_date}} group by 2`\r\n7. but i got nothing\r\n\r\n\r\n### Technical details:\r\n\r\n* Redash Version: Re:dash 0.11.1+b2095\r\n* Browser/OS: chromium/archlinux\r\n* How did you install Redash: docker\r\n"},"comment":{"url":"https://api.github.com/repos/getredash/redash/issues/comments/253131109","html_url":"https://github.com/getredash/redash/issues/1340#issuecomment-253131109","issue_url":"https://api.github.com/repos/getredash/redash/issues/1340","id":253131109,"user":{"login":"arikfr","id":71468,"avatar_url":"https://avatars.githubusercontent.com/u/71468?v=3","gravatar_id":"","url":"https://api.github.com/users/arikfr","html_url":"https://github.com/arikfr","followers_url":"https://api.github.com/users/arikfr/followers","following_url":"https://api.github.com/users/arikfr/following{/other_user}","gists_url":"https://api.github.com/users/arikfr/gists{/gist_id}","starred_url":"https://api.github.com/users/arikfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikfr/subscriptions","organizations_url":"https://api.github.com/users/arikfr/orgs","repos_url":"https://api.github.com/users/arikfr/repos","events_url":"https://api.github.com/users/arikfr/events{/privacy}","received_events_url":"https://api.github.com/users/arikfr/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T06:34:11Z","updated_at":"2016-10-12T06:34:11Z","body":"You probably need to quote the parameters, i.e. '{{start_date}}'.\n\nOn Oct 12, 2016 9:22 AM, \"Ethan Lin\" <notifications@github.com> wrote:\n\n> Issue Summary\n>\n> Mysql query. when I tried to compare a datetime field with a date type\n> parameter, it failed because the parameter was calculated.\n> Steps to Reproduce\n>\n>    1. select a mysql datasource\n>    2. try this sql select date(datetime_field),\n>    {{start_date}},{{end_date}} from mytable\n>    3. set the start_date and end_date type to date.\n>    4. set the start_date to 2016-10-06 and end_date to 2016-10-10\n>    5. get the result like this:\n>\n> DATE(CREATETIME) 2016-10-06 2016-10-10\n> 04/01/16 2,000 1,996\n>\n>\n>    1. what i really want is select count(0), date(datetime_field) from\n>    mytable where date(datetime_field) between {{start_date}} and {{end_date}}\n>    group by 2\n>    2. but i got nothing\n>\n> Technical details:\n>\n>    - Redash Version: Re:dash 0.11.1+b2095\n>    - Browser/OS: chromium/archlinux\n>    - How did you install Redash: docker\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/getredash/redash/issues/1340>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAEXLNNywJzJMF5C_ebZZG4I7_z_zKdNks5qzHy4gaJpZM4KUaCB>\n> .\n>\n"}}
{"actor":{"display_login":"arikfr"}}