Alex Thurgood <alex.thurgood@stripped> wrote:
> I'm just learning to get to grips with mysql, and I've been looking at
> the date functions. I want to be able to define a table that will take a
> starting date e.g. "action_date" and then use the value entered here to
> automatically calculate a second date to be inserted automatically into
> field "final_date" , using a third value taken from another field
> "time_limit" as the variable for the addition.
> I understand that statically this can be done using the INTERVAL
> function :
> action_date + INTERVAL 4 MONTH
> but I can't see how to replace this interval value with one from the
> field "time_limit" (defined as int) and insert the result into a second
> field "final_date". Can I do this in a create table statement or is that
> not possible ?
No, you can specify this in CREATE TABLE statement, but you can use DATE and TIME
functions in the INSERT statement.
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ Victoria.Reznichenko@stripped
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net