What you could try - before clearing the datalogger.
Shutdown the virtual station software, and start weatherlink (the software that came with your station). At startup, it will transfer all the data from the datalogger. From there you can update back wunderground to get that database with valid data (choosing specific period of data from the menu to only update the erronus data).
Once that's done, shutdown weatherlink and go back to your usual software setup.
As for the error itself, it might be a synchronization error at some point between the datalogger, the software and the database.
To prevent that, make sure there's enought delay between records - that is usually set in your software, not on your console - remember the console is slave and only cares about the station's sensors. All exchange are managed by the datalogger and the software. The data is pickup by the software requesting it from the datalogger. I've never seen bad data in a datalogger, all the problem i've seen with the data were from the software not being able to handle error conditions at some point (overload, buffer underrun, buffer overflow), and messing up its own database with bad data (bad data being created by the software itself... catch22).
If you have that issue again or often, try asking for guidance from the Ambiant Virtual Weather station forum. I'm sure someone in that group of users will be able to set you up with such issue. Read that thread on that forum (
http://www.wxforum.net/index.php?topic=8034.0) or search the Ambiant forum with the word ''corrupted'', you'll find a lot of answers.
Good luck.
Additional detail : in your database, try to find the last valid record before the error. Then remove all the bad records following it until the next good record (about two days of bad data from what you said). After that, you might be able to regain those records if they are still on the datalogger. That will fix your database.