[MDEV-2714] LP:603750 - Problems with curdate()-1 function when is first day of the month Created: 2010-07-09 Updated: 2012-10-04 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Pablo Alejandro Manyoma Vallejos (Inactive) | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
curdate() function is for get current date value, acording documentation when you use: curdate()-1 you will obtain yesterday date value, but when is the first day of the month (for example: July 1, 2010) you got a wrong value!, you will get July 0, 2010 in our example (20100700). To avoid this I use: from_unixtime(unix_timestamp(curdate()) - 86400) but I think that curdate()-1 function have to work fine every day and not only when curent day of the month is greater than 1 I am using: 5.1.42-MariaDB-mariadb73 version |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2010-07-10 ] |
|
Re: Problems with curdate()-1 function when is first day of the month SELECT CURDATE() - INTERVAL 1 DAY ; or SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) ; Can you please point out the location in the documentation where you took your query from? |
| Comment by Rasmus Johansson (Inactive) [ 2010-07-16 ] |
|
Launchpad bug id: 603750 |