Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / October 2003

Tip: Looking for answers? Try searching our database.

Help With UPDATE Query in mySQL

Thread view: 
Shaun - 03 Oct 2003 22:55 GMT
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
Frank Brouwer - 06 Oct 2003 14:52 GMT
Hi Shaun,

Try this:

update owner.table_name
set date_field_start = cast(convert(char, date_field_start, 12) + ' 09:00'
as datetime),
    date_field_end = cast(convert(char, date_field_end, 12) + ' 17:30' as
datetime)

success,

Frank.

> Hi,
>
[quoted text clipped - 4 lines]
>
> Thanks for your help


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.