[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: DATE problem
From:       Gleb Paharenko <gleb.paharenko () ensita ! net>
Date:       2006-01-10 10:51:29
Message-ID: m6gc93xd22.ln2 () blend ! ensita ! net
[Download RAW message or body]

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



Mester József wrote:
> 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@ensita.net
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic