Jump to content

[SOLVED] Not able to alter column with timestamp to only YYYY-MM-DD


Linda_swe

Recommended Posts

Hi  ;)

 

I am trying to find a solution on how to fetch all unique dates from a timestamp (YY-MM-DD-HH-MM-SS). Since HH-MM-SS is included i get a lot of rows from the same date. I would like to do this so i can calculate the sum between the dates .Currently i am using between curdate() and interval 1 day but my plan is to use it in a for loop between the first entry date and the second one (even if they are separated by three days for instance)

 

Of course i could write code to loop through the array and try to sort out unique dates from there but i would prefer to fetch them directly with a SQL query or alter the table and column so the timestamp only show 8 digits..but haven't had any luck.

 

 

My second guess is doing a select statement and save it as and then somehow use DATE(timestamp) on all rows.

 

Any ideas?

 

Thanks  :)

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.