How Do I convert a Date to ddmmyyyy format in a view (with no delimiters)

Posted on 2003-11-21
Last Modified: 2010-05-18
I have tried using the convert and cast functions but of the available options i dont seem to be able to get ddmmyyyy without delimters. I am actually trying to export a view to a csv text file but the data transformation service doesnt work if the output is to a text file - it has to be to another column so I assume a table. I therefore want to inbuild the conversion into a view..........

Please Help !!!!!!


Question by:duffster
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
LVL 43

Accepted Solution

TimCottee earned 250 total points
ID: 9796816
Hi duffster,

You could always use:

Select Replace(Convert(varchar,MyDateField,103),'/','') As MyNewDate

Brainbench MVP for Visual Basic
LVL 15

Expert Comment

ID: 9796827
Try this, replace getdate() with your datetime column

select convert(char(2), datepart(dd, getdate())) +  convert(char(2), datepart(mm, getdate()))
   + convert(char(4), datepart(yy, getdate()))

Author Comment

ID: 9796892
Many thanks Tim - That worked perfectly - The online help in sql has delusions of adequacy. I am most grateful for your assistance.



Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove () 10 40
SQL Lag Function DateDiff 2 26
Creating a View from a CTE 15 46
SQL Query 9 27
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

732 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