Dunno if I am in the right forum or not.
For school project we have a database the date format is dd-mm-yyyy
We need to import this database in a program that uses phpmyadmin but the data format in that database is yyyy-mm-dd
I found this:
Source: http://stackoverflow.com/questions/331002/change-default-date-time-format-on-a-single-database-in-sql-serverCode:declare @dates table (orig varchar(50) ,parsed datetime) SET DATEFORMAT ydm; insert into @dates select '2008-09-01','2008-09-01' SET DATEFORMAT ymd; insert into @dates select '2008-09-01','2008-09-01' select * from @dates
But I don't really understand it.
I also tryed making the database just the yyy-mm-dd format but that ends op with 0000-00-00 in the records.
My teacher also said something about the left(), mid(), right() functions, I looked it up and readed that's used for showing parts not reverse inputting them?
So my question is:
How can i reverse the dateformat from dd-mm-yyyy to yyyy-mm-dd withouth ending op with a 0000-00-00 but with 1953-12-23 for example the original date in the database