Solved

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

Posted on 2003-11-21
3
531 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
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…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now