Solved

format date like AAAAMMDDHHMMSS

Posted on 2012-03-21
1
668 Views
Last Modified: 2012-06-21
Hello,

How can I format msdb.dbo.backupset.backup_finish_date like AAAAMMDDHHMMSS?

Thanks

Regards

bibi
0
Comment
Question by:bibi92
1 Comment
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 37747080
something like this:

select left(replace(replace(replace(CONVERT(VARCHAR(26), GETDATE(), 121), '-', ''), ':', ''), ' ', ''), 14)

BTW, SQL 2012 is coming with formatting functions.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

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.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to shrink a transaction log file down to a reasonable size.

860 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