Solved

datetime convert not seconds

Posted on 2012-04-12
2
203 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
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 24

Accepted Solution

by:
DBAduck - Ben Miller earned 500 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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…

757 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

19 Experts available now in Live!

Get 1:1 Help Now