Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Microsoft SQL Server Management Studio Express - datetime Expand / Collapse
Author
Message
Posted Sunday, October 28, 2007 11:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 2, 2007 10:13 AM
Points: 2, Visits: 4
How do I make Microsoft SQL Server Management Studio Express display Datetime variables in a table in the format of my choice ( when viewing those timedate variables on Studio Express)

Currently they display as nn/dd/yy hh:mm:ss AM/PM

I would much prefere to see them as yyyy/nn/dd HH:mm:ss

( I appreciate they are stored ion the database as Timedate (double integer) -- I am talking aboit how the application STudio Express choses for format the date & time when it displays the values in the tables)

Post #415793
Posted Sunday, October 28, 2007 1:43 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 1:31 PM
Points: 416, Visits: 573
You can convert current date as you required by below piece of code


select convert(varchar(25),getdate(),101)

You can change the last variable value from 101 to 121 and each value represent one datetime format


Regards..Vidhya Sagar
SQL-Articles
Post #415798
Posted Sunday, October 28, 2007 1:56 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 1:31 PM
Points: 416, Visits: 573
Refer the below link for more on the topic
http://www.databasejournal.com/features/mssql/article.php/10894_2197931_1


Regards..Vidhya Sagar
SQL-Articles
Post #415803
Posted Monday, October 29, 2007 8:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 2, 2007 10:13 AM
Points: 2, Visits: 4
vidhya sagar (10/28/2007)
You can convert current date as you required by below piece of code


select convert(varchar(25),getdate(),101)

You can change the last variable value from 101 to 121 and each value represent one datetime format


Thanks for the reply, but you may have missed the point of the question.

How do I get "Microsoft SQL Server Manager Studio Express" to display "datetime" variables in the format of my choice.
Ideally for any database and any table I use the application for.

One would assume that there was a Preference settting somewhere to control how the application displays a "datetime" variable. ???

However, if you have given me the answer, I must admit I am a SQL novice, and therefore do not know how to apply your answer to the "Studio Express" application. :)
Post #416052
Posted Thursday, December 13, 2007 2:19 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 19, 2014 1:04 PM
Points: 45, Visits: 129
I will try to naswer to your question.

You wrote:

Thanks for the reply, but you may have missed the point of the question.

How do I get "Microsoft SQL Server Manager Studio Express" to display "datetime" variables in the format of my choice.
Ideally for any database and any table I use the application for.

One would assume that there was a Preference settting somewhere to control how the application displays a "datetime" variable. ???


Try this:

1. Open Microsoft SQL Server Manager Studio Express, and connect to your SQL Server.

2. Find New Query label on the top-left side of SQL Server Management Studio.

Simply type:

SELECT convert(varchar(25) getdate(), 101)

and click EXECUTE button.

This will make SQL Server to display your date/time format as you wish. You could change number 101 by others between 101 and 125.

Hope that this will help
Post #432711
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse