Solved

format computed column to remove time from datetime column

Posted on 2008-06-25
3
1,684 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

920 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

12 Experts available now in Live!

Get 1:1 Help Now