Russell Fields
3/15/2007 1:31:00 PM
Steve,
Use CONVERT styles and string concatenation.
declare @date datetime
declare @hour varchar(10)
select @date = '1/1/2007'
select @hour = '11:30'
select CONVERT(DATETIME, CONVERT(VARCHAR(10), @date, 101) + ' ' + @hour)
RLF
"Sawlmgsj" <Sawlmgsj@discussions.microsoft.com> wrote in message
news:EF3E162E-E45B-4A5A-B983-C5FBD6417849@microsoft.com...
>I have a table with 2 fields - a Date/Time containing an appointment date
>and
> a VarChar containing an appointment time in a format such as 11:30 (I have
> inherited this arrangement from an existing structure. I could change the
> format of the time if necessary.)
>
> I need to create an UPDATE trigger that populates another true Date/Time
> field with both parts (of the appointment) whenever the separate date or
> time
> fields are changed.
>
> I need a true Date/Time field in order to populate a diary system.
>
> Can you help?
>
> Thanks,
> Steve.
>
>