?
Solved

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

Posted on 2003-11-21
3
Medium Priority
?
535 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 1000 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

Industry Leaders: 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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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 utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

765 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