470,870 Members | 1,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

Converting DateTime

Hi,
When I open a tabe in the SQL enterprise manager I see the Timestamp Field
in this Format :
24/01/2005 16:45:00

However when I'm using the Query analyzer or other SQL Client I see the
Timestamp Field in this Format :
2005-01-24 16:44:59.997

Does Anybody know what to do in order to display the Timestamp Field in
first Format (24/01/2005 16:45:00) ?

Please Advise,
Yariv

--
Message posted via http://www.sqlmonster.com
Jul 23 '05 #1
3 1979
Look up "Date Time String Transformation" in SQL Server BOL

"Yariv via SQLMonster.com" <fo***@SQLMonster.com> wrote in message
news:73******************************@SQLMonster.c om...
Hi,
When I open a tabe in the SQL enterprise manager I see the Timestamp Field
in this Format :
24/01/2005 16:45:00

However when I'm using the Query analyzer or other SQL Client I see the
Timestamp Field in this Format :
2005-01-24 16:44:59.997

Does Anybody know what to do in order to display the Timestamp Field in
first Format (24/01/2005 16:45:00) ?

Please Advise,
Yariv

--
Message posted via http://www.sqlmonster.com

Jul 23 '05 #2

"Yariv via SQLMonster.com" <fo***@SQLMonster.com> wrote in message
news:73******************************@SQLMonster.c om...
Hi,
When I open a tabe in the SQL enterprise manager I see the Timestamp Field
in this Format :
24/01/2005 16:45:00

However when I'm using the Query analyzer or other SQL Client I see the
Timestamp Field in this Format :
2005-01-24 16:44:59.997

Does Anybody know what to do in order to display the Timestamp Field in
first Format (24/01/2005 16:45:00) ?

Please Advise,
Yariv

--
Message posted via http://www.sqlmonster.com


Check out CONVERT() in Books Online. But you need to remember that MSSQL
stores datetime values in an internal format, and each client (including EM
and QA) decides how to display them. See here for more details:

http://www.karaszi.com/sqlserver/info_datetime.asp

Simon
Jul 23 '05 #3
Yariv via SQLMonster.com (fo***@SQLMonster.com) writes:
When I open a tabe in the SQL enterprise manager I see the Timestamp Field
in this Format :
24/01/2005 16:45:00

However when I'm using the Query analyzer or other SQL Client I see the
Timestamp Field in this Format :
2005-01-24 16:44:59.997

Does Anybody know what to do in order to display the Timestamp Field in
first Format (24/01/2005 16:45:00) ?


Under Tool->Options->Connections, check the third checkbox, "Use
regional settings...".
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by M. Uppal | last post: by
8 posts views Thread by Mika M | last post: by
3 posts views Thread by NateM | last post: by
6 posts views Thread by minboymike | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.