Solved

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

Posted on 2003-11-21
3
534 Views
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 !!!!!!

Regards


Duffster
0
Comment
Question by:duffster
[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 43

Accepted Solution

by:
TimCottee earned 250 total points
ID: 9796816
Hi duffster,

You could always use:

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

Tim Cottee MCSD, MCDBA, CPIM
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
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()))
0
 

Author Comment

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

Regards


Duffster
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

690 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