I am trying to format the date output in mySql to something like 01-DEC-1977, and I am ready to throw my computer because I just can't get it to work. this is my table:
CREATE TABLE myAuthor ( ID int(05) NOT NULL, Full_Name varchar(50) NOT NULL, Birthdate date, Country varchar(50) ); This is the data I am inserting:
INSERT INTO myAuthor(ID, Full_Name, Birthdate, Country) values(1001, 'Bob Writer', 19770112, 'USA'); and this is what I am attempting thus far to do to format the date:
select 'ID', 'Full_Name', DATE_FORMAT('Birthdate','%d-%b-%Y') from myauthor; When I do that the data comes out as null. this is the only thing I have managed to do that doesn't spit out an error or truncate the date all together.
Is there a way to format the date so that once entered it just comes out as DD-MON_YYYY, aand if not, how can I do this, or even better, what am I doing wrong? I have tried switching the date entered into insert where it is formatted with day, month and year, but I get an error when trying that. Any help would be greatly appreciated.