Solved

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

Posted on 2007-11-20
6
741 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

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

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.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

895 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