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 2000 Forums
 SQL Server Development (2000)
 change datatime structure

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2005-11-01 : 01:47:29
i have a col of datetime which its currentstructure is : yyyy-mm-dd
and i want to change it to the way its in israel to : dd-mm-yyyy
is it possible?
thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

Kristen
Test

22859 Posts

Posted - 2005-11-01 : 02:25:39
If its a column with a datetime data type then you can "format" it by converting to a string using

CONVERT(varchar(24), MyColumn, 999)

where 999 is the format definition - see Books on Line for a list.

However, it would be better to do this formatting in your client application, rather than in SQL Server, because you will have changed the data type to "string" and your application will no longer be able to manipulate this value as a date

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-02 : 00:23:59
Where do you want to show the converted dates?
If you are using Reports, then use its Format function

Madhivanan

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

- Advertisement -