Link to home
Start Free TrialLog in
Avatar of robthomas09
robthomas09

asked on

SQL - Syntax help String Manipulation - SQL Server 2005

Hello experts,

I am really reaching on this one, but I have a scenario that I need help coding please, not sure if it can be done.  I have a table of appointments below, and there are two columns, both varchar(50) datatypes.  The time and date fields were accidentally merged, and I need to unmerge them.  I currently have:

table: appointments
appt_date             appt_time
null                        Appointment date: 02/28/2011
null                        08:00 AM
null                        09:00 AM
null                        10:00 AM
null                        11:00 AM
null                        Appointment date: 02/29/2011
null                        08:00 AM
null                        09:00 AM
null                        10:00 AM
null                        11:00 AM
null                        Appointment date: 02/30/2011
null                        08:00 AM
null                        09:00 AM
null                        10:00 AM
null                        11:00 AM

and I need:

table: appointments
appt_date                                      appt_time
Appointment date: 02/28/2011      08:00 A
Appointment date: 02/28/2011      08:00 AM
Appointment date: 02/28/2011      09:00 AM
Appointment date: 02/28/2011      10:00 AM
Appointment date: 02/28/2011      11:00 AM
Appointment date: 02/29/2011      08:00 A
Appointment date: 02/29/2011      08:00 AM
Appointment date: 02/29/2011      09:00 AM
Appointment date: 02/29/2011      10:00 AM
Appointment date: 02/29/2011      11:00 AM
Appointment date: 02/30/2011      08:00 A
Appointment date: 02/30/2011      08:00 AM
Appointment date: 02/30/2011      09:00 AM
Appointment date: 02/30/2011      10:00 AM
Appointment date: 02/30/2011      11:00 AM

update appointments
set appt_date ?

Thoughts?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of robthomas09
robthomas09

ASKER

Thanks