Here's a simple piece of code for creating a string in YYYYMMDDHHMMSS format, suitable for use as a filename:
REPLACE(REPLACE(REPLACE(CONVERT(char(19), GETDATE(), 120), ' ', ''), '-', ''), ':', '')
If you ran this at 1:23:05 PM on December 3, 2006, it would return "20061203132305".
Showing posts with label date time string format. Show all posts
Showing posts with label date time string format. Show all posts
Wednesday, April 18, 2007
Handy SQL Server Query: Date String For Filename
Posted by
Thomas
at
4/18/2007 09:27:00 PM
1 comments
Labels: date time string format, query analyzer, sql server
Subscribe to:
Posts (Atom)