At 13:06 -0400 10/6/03, Franck Babin wrote:
It's a syntax error. Even when I try without DATE_FORMAT:

UDPATE activity SET activity_date = '2003-10-06 11:00:00', type_no = 1 WHERE activity_date =
'2003-06-10 11:15:00' AND type_no = 1;

Ah.


Perhaps spelling UDPATE as UPDATE will fix the problem. :-)



--- Paul DuBois <[EMAIL PROTECTED]> wrote: > At 12:55 -0400 10/6/03, Franck Babin wrote:
>I have made some changed but it still doesn't work:
>
>UDPATE activity SET activity_date = '2003-10-06 11:00:00', type_no = 1 WHERE
>DATE_FORMAT(activity_date,'%Y-%m-%d %H:%i:%s') = '2003-06-10
>11:15:00' AND type_no = 1;
>
>I want to update only rows where <activity_date> equals '2003-06-10 11:15:00'
>Is this formulation correct?
>
><activity_date> is really a DATETIME field.
>Thanks.


In that case, you don't need DATE_FORMAT() at all. Just compare activity_date
to the datetime value directly.


 You still haven't indicated what you mean by the statement not working.
 It doesn't find any rows to update?  Do you get any results from
 the following statement, which simply tests the comparison?

SELECT activity_date FROM activity
> WHERE activity_date = '2003-06-10 11:15:00';


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


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



Reply via email to