List:General Discussion« Previous MessageNext Message »
From:Victoria Reznichenko Date:May 26 2003 3:57pm
Subject:Re: Automatic calculation of date additions
View as plain text  
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
       <___/   www.mysql.com




Thread
Automatic calculation of date additionsAlex Thurgood25 May
  • Re: Automatic calculation of date additionsVictoria Reznichenko26 May
Re: Automatic calculation of date additionsAlex Thurgood26 May
  • Re: Automatic calculation of date additionsVictoria Reznichenko31 May