Solved

format computed column to remove time from datetime column

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.

726 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