Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

636 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