Look at Cast and Convert in Books Online. That has a bunch of out-of-the-box conversion formats for datetime to varchar values.You may need to apply some string manipulation to tweak the values to just the way you need them. Here is a format version without the seconds/milliseconds and 12 hour format:select convert(varchar, dt, 100) [full] --straight convert to varchar ,right(convert(varchar, dt, 100),7) [right7] --just the time portion of the date ,stuff(right(convert(varchar, dt, 100),7), 6, 0, ' ') [with_space] --if you need a space before AM/PMfrom (select convert(datetime, '1/1/1900 9:34:00 PM') as dt) doutput:full right7 with_space------------------------------ ------- ----------Jan 1 1900 9:34PM 9:34PM 9:34 PM
Be One with the OptimizerTG