Solved

how to retrieve in date time as dd-mm-yyyy hh:mm:ss:ss

Posted on 2007-11-20
6
731 Views
Last Modified: 2012-05-05
Hi experts,

how do i achieve the above

thanks
0
Comment
Question by:SirReadAlot
  • 3
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
talspaugh27 earned 250 total points
ID: 20321115
select convert(varchar(30), getdate(), 105) + ' ' + convert(varchar(30), getdate(), 108)
change the getdate to your date parameter
0
 
LVL 6

Assisted Solution

by:wshark83
wshark83 earned 250 total points
ID: 20321117
select getdate(), convert(varchar(12), getdate(), 107), convert(varchar(10), getdate(), 108)

Results

getdate()
2007-11-20 16:51:11.460      

convert(varchar(12), getdate(), 103)
20/11/2007

convert(varchar(10), getdate(), 108)
16:51:11
0
 
LVL 2

Expert Comment

by:talspaugh27
ID: 20321161
lol both comments came in at the exact same time, looks like EE needs to break it down to the second level on the timestamps
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:SirReadAlot
ID: 20321180
sorry

i forgot like this

dd-mm-yyyy hh:mm:ss:sss

sorry
0
 

Author Comment

by:SirReadAlot
ID: 20321223
ignore above post pls
0
 
LVL 2

Expert Comment

by:talspaugh27
ID: 20321930
if you are wanting the milliseconds also would be
select (convert(varchar(30), getdate(), 105) + ' ' + convert(varchar(30), getdate(), 114))
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

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

11 Experts available now in Live!

Get 1:1 Help Now