Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to replace date format

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2008-05-26 : 01:57:04
HI

in my table one date field(taskdate) it has a lot records with this format (Mar 3 2008 8:51AM) i want to replace all records with this format(dd/MM/yyyy).

please help me out,

raky
Aged Yak Warrior

767 Posts

Posted - 2008-05-26 : 02:16:12
Instead of replacing data with this format, get that format while displaying the taskdate.u can do this by using convert function.For example
SELECT CONVERT(VARCHAR(40),GETDATE(),103)

Similarly
SELECT
CONVERT(VARCHAR(40),TASKDATE,103)
FROM
TABLENAME
Go to Top of Page

asifbhura
Posting Yak Master

165 Posts

Posted - 2008-05-26 : 02:19:25
Thank you, it is done

please help me in my another post
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-05-26 : 05:17:24
quote:
Originally posted by asifbhura

HI

in my table one date field(taskdate) it has a lot records with this format (Mar 3 2008 8:51AM) i want to replace all records with this format(dd/MM/yyyy).

please help me out,


What is the datatype of the column?
Also consider doing the formation at front end application

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -