I have a table that contains hourly work done on projects.  It has 
a basic structure of (extraneous fields left out):

+------------+------------------+------+
| Field      | Type             | Null |
+------------+------------------+------+
| ID         | int(10) unsigned |      |
| ProjectID  | bigint(20)       |      |
| ContactID  | int(10) unsigned | YES  |
| NotesID    | int(10) unsigned | YES  |
| Start_Time | datetime         |      |
| End_Time   | datetime         | YES  |
+------------+------------------+------+

I had made 4 entries for a day that had the wrong date;
eg "2001-07-01 9:00" instead of "2001-08-01 9:00".

I did a seconds count between the incorrect times and the
correct times (2592000) and then ran:

UPDATE ProjectTime set Start_Time=UNIX_TIMESTAMP(Start_Time)+2592000;

This gave me warnings and thats when I realised that I hadn't
put a WHERE clause in, so I ran the same query in reverse (-2592000).

Now all of my entries (in the entire table) have '0' for their
Start_Time.

1) Is there any way (besides a restore from a 24hr old
backup tape) to get the old values back?
2) Why did these queries fail to do what I'd expected?
-- 
Mike Babcock



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to