Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

GetDateTime Function

By Luis Atondo,

How to use:

 

DECLARE @DTest datetime

SET @DTest=dbo.GetDateTime('200907111400')

SELECT @DTest as Test

 

Result: 2009-07-11 14:00:00.000

Total article views: 1022 | Views in the last 30 days: 3
 
Related Articles
SCRIPT

GetDateTimeString Function

This function gets a variable and converts to DateTime format string 'YYYYMMDDHHMM' Ex. '07/11/2...

FORUM

stored procedures / batch file

Hi, I have a single test.sql file with about 7 stored procedures in it. create proc xxx1 as .......

FORUM

Truncating Transaction Logs

We are writing queries to determine if a transaction log was truncated since the last backup.  We ha...

FORUM

Need help for SQLCMD

Post by Dhananjay

FORUM

Migrating isql command to sqlcmd in SQL 2005 Issue

Format of the field returned in the output of isql & SQLCMD is different

Tags
cast    
convert    
datetime    
function    
substring    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones