Your technology certification is waiting. Enroll in Cloud Class ®
select convert(varchar(8),getdate(),3) as [date_style_3]
, stuff(convert(varchar(8),getdate(),3),1,3,'') as [mm/yy with stuff]
,right(convert(varchar(8),getdate(),3),5) as [mm/yy last 5 char]
Open in new window
The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.
PATTERN STYLED DATE SYNTAX STYLE LENGTH
DD MM YY 23/02/01 convert(varchar(8), your_data_here ,3) 3 8
DD MM YY 23.02.01 convert(varchar(8), your_data_here ,4) 4 8
DD MM YY 23-02-01 convert(varchar(8), your_data_here ,5) 5 8
, STUFF(CONVERT(varchar(10),getdate(), 1), 4, 3, '')
Not sure why anyone would choose the arcane world of style numbers over the more intuitive FORMAT() syntax.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Your question, your audience. Choose who sees your identity—and your question—with question security.