How about posting what you have so we are not guessing about how you are currently doing things when trying to present a solution that doesn't involve too much of a rewrite.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Seems a very clear and concise error message to me.
You're trying to turn something into a date that isn't recognised as a date.
The solution is to make sure it is recognised, using the relevant formatters and converters provided in the standard library.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Please use code tags.
Ain't you supposed to do that now you're a moderator Jeroen? He he.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
If you have MySQL 5.0 or later you can start your mysql server with the option --sql_mode="NO_ZERO_DATE" , or to be even more restricitive --sql_mode="STRICT_ALL_TABLES" , so that insertion of invalid dates will cause an error (and not be inserted). If you are 4.1 or earlier, you will have to check the date programmatically before the insert so that entering of invalid dates does not occur (which you should be doing anyway).
Edit:
Also, if you can afford to ignore records with invalid dates, then when selecting your records insert
AND HireDate != '0000-00-00'
AND OpenDate != '0000-00-00'
AND EditDate != '0000-00-00'
into your Where clause so that invalid records will not cause your statement to crash.
Otherwise, do not use getDate to get the Date Column. Use getString and then parse the date using SimpleDateFormat and catch any exception in order to set the date with a default value (say new Date(0) maybe). This will also keep your statements from crashing.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
It isn't recognised as a date, period.
It's up to you to make sure only things that are recognised as dates are inserted...
The actual date given (whether the string can be parsed to an actual date or not) is impossible from your original message to know.
Many people will give some value like 00-00-0000 to indicate any date, and it might have been the driver returning that message because it doesn't recognise the actual format used.
Maybe you should be less agressive towards people trying to help, it doesn't make them any more likely to help you in the future.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337