?
Solved

datetime convert not seconds

Posted on 2012-04-12
2
Medium Priority
?
227 Views
Last Modified: 2012-06-21
How do I convert datetime to 12.4. 21:50?
I.e. not year and not seconds.
0
Comment
Question by:johnkainn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 37840558
there is no built in way of doing it
you can try

select datepart(day, date_column) + '.' + datepart(month, date_column) + '. ' + datepart(hour, date_column) + ':' + datepart(minute, date_column)
0
 
LVL 25

Accepted Solution

by:
DBAduck - Ben Miller earned 2000 total points
ID: 37841153
You could look at the CONVERT statement and use something like in here:
http://technet.microsoft.com/en-us/library/ms174450.aspx

If you convert the date to just a date and then take a LEFT(@string, 5) you could get the date and then do the same for the time.  
The above post would work as well.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

777 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