Maybe not.  MySQL won't auto-maintain a date field.

I can't count the number of times that some unanticipated issue was solved
through having separate modifydate and createdate fields, with the
modifydate being maintained by MySQL (which means that I don't have to worry
about it going out of sync from ad hoc update queries).


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Douglas Forrest" <[EMAIL PROTECTED]>
Sent: Wednesday, March 06, 2002 7:54 AM
Subject: Re: TIMESTAMP not acting as I'd like


> At 07:43 06/03/2002 -0500, you wrote:
>
> Thanks, I think I am complicating things too much.
> Using DATE will probably suffice.
>
> Rob
>
> >Use multiple timestamp columns in the table, i.e., modifydate and
orderdate.
> >MySQL will only maintain the first timestamp column in tables with more
than
> >one timestamp column, leaving the subsequent timestamp columns unchanged
and
> >up to you to maintain.
> >
> >Alternatively, you may (I didn't test) be able to re-set the column to
> >maintain its orginal value in your update statement (add ",  orderdate =
> >orderdate " to the set portion of your query.
> >
> >
> >----- Original Message -----
> >From: <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, March 06, 2002 7:19 AM
> >Subject: TIMESTAMP not acting as I'd like
> >
> >
> >>
> >> Hi,
> >>
> >> small problem. I have a table set up like so. It has a number of
entries
> >> that were added on a certain date, I use TIMESTAMP to keep track of the
> >date.
> >>
> >>
>
>+---------------------+---------------+------+-----+---------+-------------
-
> >> --+
> >> | Field               | Type          | Null | Key | Default | Extra
> >>   |
> >>
>
>+---------------------+---------------+------+-----+---------+-------------
-
> >> --+
> >> | auto                | mediumint(10) |      | PRI | NULL    |
> >> auto_increment |
> >> | accref              | varchar(6)    | YES  |     | NULL    |
> >>   |
> >> | orderdate           | timestamp(8)  | YES  |     | NULL    |
> >>   |
> >> | version             | varchar(9)    | YES  |     | NULL    |
> >>   |
> >> | upgradep            | varchar(4)    | YES  |     | NULL    |
> >>   |
> >> | status              | varchar(8)    | YES  |     | NULL    |
> >>   |
> >> | status_relate_to_id | int(11)       | YES  |     | NULL    |
> >>   |
> >>
>
>+---------------------+---------------+------+-----+---------+-------------
-
> >> --+
> >>
> >> Unfortunately, I used this query on the table
> >>
> >> mysql> UPDATE deerfield SET version = '2.1' WHERE product = 'WinGate
> >LITE';
> >>
> >> and all of the dates of the filed that match the where clause updated
to
> >> today's date. How can I avoid this? Is there a problem with the set-up
of
> >> the timestamp itself.
> >>
> >> Any help would be greatly appreciated.
> >>
> >> Rob
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >>
> >
> >
> >
>


---------------------------------------------------------------------
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