Re: setting the default of a date field

2012-01-28 Thread william drescher

On 1/27/2012 6:00 PM, Peter Brawley wrote:

On 1/27/2012 2:24 PM, william drescher wrote:

On 1/27/2012 3:21 PM, Peter Brawley wrote:

On 1/27/2012 11:18 AM, william drescher wrote:

Is there a way to set the default of a date field to the date
the record is generated ?

bill



Use a TIMESTAMP. Default DATE(TIME) columns with Triggers.

PB


When I try
ALTER TABLE `ptInfo` CHANGE `lastQuarterlyReview`
`lastQuarterlyReview` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP
I get:
#1067 - Invalid default value for 'lastQuarterlyReview'


Yes, if you want a default value use a timestamp column.



Thanks Peter


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: setting the default of a date field

2012-01-27 Thread Peter Brawley

On 1/27/2012 11:18 AM, william drescher wrote:
Is there a way to set the default of a date field to the date the 
record is generated ?


bill



Use a TIMESTAMP. Default DATE(TIME) columns with Triggers.

PB

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: setting the default of a date field

2012-01-27 Thread william drescher

On 1/27/2012 3:21 PM, Peter Brawley wrote:

On 1/27/2012 11:18 AM, william drescher wrote:

Is there a way to set the default of a date field to the date
the record is generated ?

bill



Use a TIMESTAMP. Default DATE(TIME) columns with Triggers.

PB


When I try
ALTER TABLE `ptInfo` CHANGE `lastQuarterlyReview` 
`lastQuarterlyReview` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP

I get:
#1067 - Invalid default value for 'lastQuarterlyReview'

bill


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: setting the default of a date field

2012-01-27 Thread Peter Brawley

On 1/27/2012 2:24 PM, william drescher wrote:

On 1/27/2012 3:21 PM, Peter Brawley wrote:

On 1/27/2012 11:18 AM, william drescher wrote:

Is there a way to set the default of a date field to the date
the record is generated ?

bill



Use a TIMESTAMP. Default DATE(TIME) columns with Triggers.

PB


When I try
ALTER TABLE `ptInfo` CHANGE `lastQuarterlyReview` 
`lastQuarterlyReview` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP

I get:
#1067 - Invalid default value for 'lastQuarterlyReview'


Yes, if you want a default value use a timestamp column.

PB

-



bill




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql