Solved

format computed column to remove time from datetime column

Posted on 2008-06-25
3
1,682 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
Comment Utility
CONVERT(VARCHAR,DateColumn,101)
0
 

Author Comment

by:mphillip85
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

763 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

11 Experts available now in Live!

Get 1:1 Help Now