Solved

How to convert datetime to date

Posted on 2008-10-24
3
322 Views
Last Modified: 2012-06-21
Could someone help me display the below formula as a date only:

CONVERT(varchar(10), getdate() - 4, 101)

Thanks a bunch!!

0
Comment
Question by:luv2kids
[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
  • 2
3 Comments
 
LVL 2

Expert Comment

by:brainbolt
ID: 22799875
Not sure what you mean.  Can you give an example of what you are wanting to get.

BTW, what DB are you using? SQL Server? Which version?
0
 

Author Comment

by:luv2kids
ID: 22799924
SQL Server 2000

The code as is displays:  2008-10-20 00:00:00.000
I want it to display as: 2008-10-20
0
 
LVL 2

Accepted Solution

by:
brainbolt earned 500 total points
ID: 22799976
I'm running SQL Server 2000 and when I execute the following in Query Analzyer:

select CONVERT(varchar(10), getdate() - 4, 101)

I get "10/28/08"

Where are you running the query?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
How to increase the row limit in Jasper Server.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

695 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