Solved

Get the current date in the format ddmmyy

Posted on 2007-11-21
3
1,399 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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 video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

737 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