Solved

Get the current date in the format ddmmyy

Posted on 2007-11-21
3
1,400 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 143

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

691 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