Re: HELP With UPDATE Query in mySQL

From: Date: Mon, 06 Oct 2003 14:11:36 +0000
Subject: Re: HELP With UPDATE Query in mySQL
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-30883@lists.php.net to get a copy of this message
and put it inside a transaction cos in case something goes wrong part of the way through pete Jeff Shapiro wrote:
This should do it: UPDATE Bookings SET Booking_Start_Date = CONCAT(DATE_FORMAT(Booking_Start_Date, '%Y-%m-%d'), '09:00:00'), Booking_End_Date = CONCAT(DATE_FORMAT(Booking_End_Date, '%Y-%m-%d'), '17:30:00'); If you are using version 4.1.1 or newer the DATE_FORMAT function could be replaced by: DATE(Booking_Start_Date) On Fri, 3 Oct 2003 22:54:49 +0100, Shaun spoke thusly about [PHP-DB] HELP With UPDATE Query in mySQL:
Hi, I have two columns in my Bookings table of type DATETIME - Booking_Start_Date and Boking_End_Date. How can i update every row so that all of the times for Booking_Start_Date are 09.00 and all of the times for Booking_End_Date are 17.30, without affecting any of the dates? Thanks for your help
--- Listserv only address. Jeff Shapiro


« previous php.db (#30883) next »