Solved

format computed column to remove time from datetime column

Posted on 2008-06-25
3
1,685 Views
Last Modified: 2012-05-05
I need to format the datetime on a columnin SQL 2005 to remove the time from the column
0
Comment
Question by:mphillip85
3 Comments
 
LVL 8

Expert Comment

by:pzozulka
ID: 21870809
CONVERT(VARCHAR,DateColumn,101)
0
 

Author Comment

by:mphillip85
ID: 21870845
this needs to work as a computed formula on the column in SQL 2005 Server table
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 21871090
drop it and then recreate it

alter table tablename
drop column yourcomputedcolumnname

alter table tablename
add yourcomputedcolumnname as convert(varchar(10), datecolumn, 101)  --you have to specify the length of the varchar field.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

770 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