FormatDate

Share your SQL code snippets for SQL Prompt!

Moderators: David Atkinson, Anu Deshpande, Luke Jefferson, Paul Stephenson

FormatDate

Postby Bill_Ross » Mon May 24, 2010 3:39 pm

Snippet name: fd
Description: Format a date as YYYY-MM-DD
Code:
CONVERT(CHAR(10), <inDate, DateTime, GETDATE()>, 23) AS [Date]

Use Ctrl-Shift-M to populate the parameter.
Defaults to GetDate()
Bill_Ross
 
Posts: 14
Joined: Mon Mar 22, 2010 6:49 pm

Return to SQL Prompt code snippets

Who is online

Users browsing this forum: No registered users and 0 guests