Solved

datetime convert not seconds

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Implementing SQL Server Data Files in Azure 1 36
today minus 2 years SQL server 2008 2 31
the whoisactive update 12 39
T SQL Update Table from another table 5 45
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

12 Experts available now in Live!

Get 1:1 Help Now