Solved

Get the current date in the format ddmmyy

Posted on 2007-11-21
3
1,391 Views
Last Modified: 2012-08-14
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
Comment
Question by:Pete_Burke
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 65 total points
ID: 20326622
Hello Pete_Burke,


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

Aneesh R
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 60 total points
ID: 20326625
DECLARE @Date varchar(15)
SET @Date = replace(convert(varchar,getdate(),3), '/', '')
0
 

Author Closing Comment

by:Pete_Burke
ID: 31410329
Split the points as the solutions arrived at the same time
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now