Solved

SQL Server 2005 Military Time

Posted on 2012-12-21
4
602 Views
Last Modified: 2012-12-21
Can anyone tell me how to do military time in sql server 2005 all columns are date time
0
Comment
Question by:charlesbaldo
4 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 38714443
SELECT CONVERT(CHAR(8),GETDATE(),14) -- hh:mm:ss

SELECT CONVERT(CHAR(30),GETDATE(),14) -- hh:mm:ss:miliseconds.
0
 
LVL 15

Expert Comment

by:tim_cs
ID: 38714447
Try convert.  http://msdn.microsoft.com/en-us/library/ms187928.aspx

CONVERT(varchar(12), DateField, 114)
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 38714449
All the various date options for CONVERT for date are here:

http://msdn.microsoft.com/en-us/library/ms187928.aspx

Take your pick for the one you need.
0
 

Author Closing Comment

by:charlesbaldo
ID: 38714462
Thanks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PERFORMANCE OF SQL QUERY 13 73
Why do I get extra rows when I do inner join? 12 39
Error when saving to sql table a '/' 5 28
Help with simplifying SQL 6 53
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question