List:General Discussion« Previous MessageNext Message »
From:william drescher Date:February 9 2012 1:55pm
Subject:Re: conditional updating
View as plain text  
On 2/9/2012 8:18 AM, Michael Dykman wrote:
> untested:
>
> update .... set mydate = IF(mydate =  '0000-00-00', now(), mydate)
>
>   - michael dykman
>

Thank you very much !

bill
> On Thu, Feb 9, 2012 at 8:14 AM, william drescher
> <william@stripped>  wrote:
>> I want to update a date field in a record. if the date in the field is
>> 0000-00-00 I want to change it to the current date.  I would appreciate
>> suggestions or links on how to do this.
>>
>> Yup, tried reading the manual, but need a bit of help.
>> I will be updating another field at the same time.
>>
>> bill
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:    http://lists.mysql.com/mysql
>>
>
>
>


Thread
conditional updatingwilliam drescher9 Feb
  • Re: conditional updatingMichael Dykman9 Feb
    • Re: conditional updatingwilliam drescher9 Feb
  • Re: conditional updatingJohnny Withers9 Feb
    • Re: conditional updatingwilliam drescher9 Feb
      • Re: conditional updatingReindl Harald9 Feb
        • Re: conditional updatingwilliam drescher11 Feb
      • Re: conditional updatingJohnny Withers9 Feb
        • Re: conditional updatingMichael Dykman9 Feb
          • Re: conditional updatingJohnny Withers9 Feb