Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL selecting date on timestamp

Tags:

date

mysql

I know this question have many similar posts but I'm having a hard time finding what I truly need.

I want to get only date from timestamp which I got the answer here. I tried that using the query below:

SELECT *, DATE('2014-04-26') FROM labor

Code above is working perfectly fine. But I want to know how do I get all records including there timestamp but only extracting the date from the timestamp

If I'm using a wrong datatype please let me know. My table structure is like this:

enter image description here

Thank you in advance.

like image 429
newbie Avatar asked Mar 04 '26 12:03

newbie


1 Answers

Try this

SELECT *, DATE(last_update) FROM labor;
like image 131
Sadikhasan Avatar answered Mar 07 '26 01:03

Sadikhasan