Jump to content

little mysql help pleas


TheSky

Recommended Posts

step 1 (optional):

backup your table

 

step 2:

Convert your date to a valid mysql date:

update my_table replace(my_date_column, '.', '-');

 

step 3:

Convert your date column to a date:

alter table my_table change  my_date_column my_date_column date not null

 

step 4:

add the code to delete dates older than 30 days:

delete from my_table where my_date_column > date_sub(now(), interval 30 day);

SQL query:

UPDATE u_statistics replace( today, '.', '-' )

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'replace(today, '.', '-')' at line 1 

am i doing somthing wrong ?

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.