List:General Discussion« Previous MessageNext Message »
From:william drescher Date:January 28 2012 2:07pm
Subject:Re: setting the default of a date field
View as plain text  
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

Thread
setting the default of a date fieldwilliam drescher27 Jan
  • Re: setting the default of a date fieldPeter Brawley27 Jan
    • Re: setting the default of a date fieldwilliam drescher27 Jan
      • Re: setting the default of a date fieldPeter Brawley27 Jan
        • Re: setting the default of a date fieldwilliam drescher28 Jan