Subject | How to update only a part of a date? |
---|---|
Author | robert_hollay |
Post date | 2004-10-27T07:37:38Z |
Hi,
In short: what is the simpliest way to update only a part (year,
or month, or day, ...) in a TIMESTAMP column?
MYTABLE (ID integer,
MYTIMESTAMP timestamp);
ID MYTIMESTAMP
----------------------
1 2094.05.12 07:51
2 2056.04.14 08:05
3 2092.10.11 07:10
4 2030.06.18 11:08
...
but it should be:
ID MYTIMESTAMP
----------------------
1 2004.05.12 07:51
2 2004.04.14 08:05
3 2004.10.11 07:10
4 2004.06.18 11:08
...
Is this possible with ONE update statement?
There are thousands of records with different (and wrong) years.
TIA, Robert
In short: what is the simpliest way to update only a part (year,
or month, or day, ...) in a TIMESTAMP column?
MYTABLE (ID integer,
MYTIMESTAMP timestamp);
ID MYTIMESTAMP
----------------------
1 2094.05.12 07:51
2 2056.04.14 08:05
3 2092.10.11 07:10
4 2030.06.18 11:08
...
but it should be:
ID MYTIMESTAMP
----------------------
1 2004.05.12 07:51
2 2004.04.14 08:05
3 2004.10.11 07:10
4 2004.06.18 11:08
...
Is this possible with ONE update statement?
There are thousands of records with different (and wrong) years.
TIA, Robert