List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:August 7 2011 5:34pm
Subject:Re: Extraneous warning 1292 (Incorrect datetime value)
View as plain text  
In the last episode (Aug 07), Marius Feraru said:
> --------------
> SELECT d, IF( DATE(d)=@rd, DATE_FORMAT("%T",d), d) wtf2 FROM dt
> --------------
> 
> +---------------------+---------------------+
> | d                   | wtf2                |
> +---------------------+---------------------+
> | 2011-08-07 10:11:12 | NULL                |
> | 1234-05-06 07:08:09 | 1234-05-06 07:08:09 |
> +---------------------+---------------------+
> 2 rows in set, 1 warning (0.01 sec)
> 
> Warning (Code 1292): Incorrect datetime value: '%T'

I think you need to swap your arguments to DATE_FORMAT.  The date comes
first, then the format string.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Extraneous warning 1292 (Incorrect datetime value)Marius Feraru7 Aug
  • Re: Extraneous warning 1292 (Incorrect datetime value)Dan Nelson7 Aug
    • Re: Extraneous warning 1292 (Incorrect datetime value)Marius Feraru7 Aug
      • Re: Extraneous warning 1292 (Incorrect datetime value)Marius Feraru18 Aug
        • Re: Wrong conversion to timestamp from character stringhsv26 Aug
  • Re: Extraneous warning 1292 (Incorrect datetime value)hsv12 Aug