?
Solved

format computed column to remove time from datetime column

Posted on 2008-06-25
3
Medium Priority
?
1,691 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
[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 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 2000 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

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