Change the date format to dd/mm/yyyy in mysql

you did not declare the Id_No as auto_increment

once you have done that, just omit Id_No from the INSERT

HURRAYYY ive done it(thanks to you my friend :slight_smile: ).Other thing,why did you say to omit the Id_No from the insert?any particular reason?
also,why cant i insert the date as 24/10/2007 ?when i tried to insert the value i got an error like–>
MYSQLException
SQLState:01004
Message:Data truncation: Incorrect datetime value: ‘25/10/2007’ for column ‘Req_Date’ at row 1
Error:0
ive heard that in whatever format i enter the date in my form, mysql will convert it into yyyy-mm-dd format internally so whats the big deal?
regards,
ajos777

the big deal appears to be that we have told you at least three times in this thread that you must enter your dates in year-month-day sequence and you don’t seem to be listening

Thats right.but i realized that when i read the reply by fellgall.Till that time i had the impression i can change the format that im entering in my form.I was completely wrong about that.And when i tried to rectify myself the id_no came my way.Thank you very much for this enlightening tour.I’ll definitely be back here for my further doubts/problems.I would like to thank you further for taking all the time for me with great amount of patience.
regards,
ajos777:D

You can enter the date in your form however you want. WHen you pass it into the query it MUST be in the format yyyy-mm-dd … you can use java to format the date into that format before passing it to the query…

Many thanks for your response ,can you please give me an example of it?
regards,
ajos777

why do you need to use java to format the date at all? why not just enter your data in yyyymmdd format? what is so difficult about doing that? are you using a form where the users are entering their dates in a different format? if so take their dates and reformat them. better still though is to not let users enter dates but use a three part pulldown with separate parts for year, month and day and then piece those variables together before entering dates into your database. that way you are guaranteed to be getting clean dates as opposed to February 30th or Mar 15th as well as March 15th etc. etc. What date is this: 10-08-2007 is it October 8th or August 10th?

Hi,
thanks for your valuable point.As for your question goes,the users who are entering the date enter in the format dd/mm/yyyy coz this is the standard format here.I’ll have to consider the options that you have given me and have a thought about it.
regards,
ajos777