Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1411
  • Last Modified:

Get the current date in the format ddmmyy

Hi Folks,

I need to get the date in the format ddmmyy, I'm using SQL Server 2000.

I've tried using :-
DECLARE @Date varchar(15)
SET @Date = convert(varchar,getdate(),112)  

Obviously 112 is the wrong style but I can't find a style in the documentation that converts to the format ddmmyy.

Any ideas?

Cheers

Pete

0
Pete_Burke
Asked:
Pete_Burke
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hello Pete_Burke,


DECLARE @Date varchar(15)
SET @Date = REPLACE(convert(varchar,getdate(),3),'/','')

Aneesh R
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
DECLARE @Date varchar(15)
SET @Date = replace(convert(varchar,getdate(),3), '/', '')
0
 
Pete_BurkeAuthor Commented:
Split the points as the solutions arrived at the same time
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now