[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a specific default value on a field


Hello all,
I'm a third year uni student in Scotland doing a year long project which
involves a fair amount of MySQL. I have the following problem and would be
appreciative if I could get some advice on solving it:

- in the script I run to create a table how do I code one DateTime field
to intially be set to a value of another DateTime field?

More specifically, I have two DateTime fields (A and B), in my creation
script I want to set the default value of B to the value of A so that
when I write a new record to the table the position of B can be left
NULL, or equivalent, but the value of A will be stored in it's place. I
later on want to change B independently to a different value than A so I
don't want a strict contraint that they must always be the same.

Thanks,
Jamie.



---------------------------------------------------------------------
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 <mysql-thread67814@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.