DateTime field...how do you remove the time?

Posted on 2005-03-18
Medium Priority
Last Modified: 2012-08-14
What is the easiest way to strip out the time in a sql server db datetime field?
Front end is ASP.Net/VB.Net...would prefer to do it in SQL Server?
Question by:samtran0331
LVL 21

Accepted Solution

Kevin3NF earned 300 total points
ID: 13579256
You mean something like:

Select Convert(varchar(11), getdate(),101)

(1 row(s) affected)

Assisted Solution

AutomaticSlim earned 200 total points
ID: 13579294
Or this....

Select CONVERT(CHAR(10), getdate(), 101)
LVL 37

Author Comment

ID: 13579305
Thanks guys!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Microsoft provides a rich set of technologies for High Availability and Disaster Recovery solutions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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.
Suggested Courses

571 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