List:General Discussion« Previous MessageNext Message »
From:Gleb Paharenko Date:January 10 2006 10:51am
Subject:Re: DATE problem
View as plain text  
Hello.

MySQL doesn't support this syntax. See:
  http://dev.mysql.com/doc/refman/5.0/en/create-table.html

If you want to automatically extract the year (month, day) part
from the inserted value, you may want to use TRIGGERS, however,
in my opinion, it is better to redesign your table structure. You
can use VIEWS to make the design of your database more flexible. See:
  http://dev.mysql.com/doc/refman/5.0/en/views.html
  http://dev.mysql.com/doc/refman/5.0/en/triggers.html



> Hy all
>   
>   I would like to get date in my web page.
>   There are three different fields. YEAR MONTH and DAY
>   I thought in SQL possible create table like this /*from my book*/
>   
>   create table dates ( input_year DATETIME YEAR TO YEAR, 
>                                 input_month  DATETIME MONTH TO MONTH,
>                                 input_day  DATETIME DAY TO DAY);
>   
>   In this example I can store year,month and day values in different fields.
>   Mysql doesn't accept this create statement.
>   
>   Joe
>   
>   
> 
> 		
> ---------------------------------
> Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com



Thread
DATE problemMester József10 Jan
  • Re: DATE problemGleb Paharenko10 Jan