Solved

SQL Server 2005 Military Time

Posted on 2012-12-21
4
596 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 39

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now