Question : Need to query and change the format output of a date column. Currently comming out as yyyy-mm-dd : 00:00:00.000

Hi, Im currently extracting information sql server 2005 tables into excel and then loading that information into a different software. The problem i have at the moment is that the date set in some of the columns is in a format that i cannot export from excel into the new software. The date format needs to be dd/mm/yyyy. However the dates are stored in the sql tables as e.g 2003-10-09 00:00:00.000.
I need to truncate the '00:00:00.000' off the date, and then change around the date format so the day is first, month is second and the year is last. Do you know a way i can do this while executing it in a query. I would prefer not to create another column. But that may be another way i guess. At moment, any possiblity would suit me. I have tried the following code,
DATEPART(mm,efa.implementeddate) as monthly, DATEPART(yyyy,efa.implementeddate) as yearly, DATEPART(dd,efa.implementeddate) as dayly, dayly + '/' + monthly + '/' + yearly as fullmonth. But this does not seem to work?
Any help much appreciated!

Answer : Need to query and change the format output of a date column. Currently comming out as yyyy-mm-dd : 00:00:00.000

Just to squeeze the last bit of performance out of SQL Server,

select convert(char(10), efa.implementeddate, 103)

using varchar causes SQL Server to keep track and size the column to the longest value after collecting all results
I notice that you're using datepart, so it must already be a datetime
Random Solutions  
 
programming4us programming4us