[Maria-discuss] Interval in MYsql query
Hello If I use below query (metrics_5.created_at)>'5/10/2018'- 28 ) it gives me some result but if i use below query (metrics_5.created_at)>'5/10/2018'- INTERVAL 28 DAY ) It does not give me any result, any one know why ?
I suggest you try to find out yourself - you could have tens of problems every day, and this list will not solve them all.When you have this kind of problems, try to find out how MariaDB interprets what you write. In this case try: SELECT '5/10/2018'- 28; Cheers,Federico Il mercoledì 16 maggio 2018, 16:07:25 CEST, Dev C <chauhan.devsur@gmail.com> ha scritto: Hello If I use below query(metrics_5.created_at)>'5/10/2018'- 28 ) it gives me some resultbut if i use below query(metrics_5.created_at)>'5/10/2018'- INTERVAL 28 DAY ) It does not give me any result, any one know why ?_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
Use the DATE_ADD( ) or DATE_SUB() function with INTERVAL as explained here: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#functio... -- Peter. On Wed, May 16, 2018 at 4:07 PM, Dev C <chauhan.devsur@gmail.com> wrote:
Hello
If I use below query (metrics_5.created_at)>'5/10/2018'- 28 ) it gives me some result but if i use below query (metrics_5.created_at)>'5/10/2018'- INTERVAL 28 DAY )
It does not give me any result, any one know why ?
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
participants (3)
-
Dev C
-
Federico Razzoli
-
Peter Laursen