Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stripping off Time

Author  Topic 

Lemmy44
Starting Member

20 Posts

Posted - 2004-03-17 : 14:34:06
Hello, I am more or less new to the SQL language, and am having quite the time trying to figure out a problem that I have been given to solve.

We run an application that uses SQL Server 2000. Most of our data is date sensitive, and we run many reports that include the date. The big problem that we are having, is that every time we display the date, we also get the time.

Is there any way to strip off the time, so that we are left with only the date?

Any suggestions or links to resources would be greatly appreciated.

Thanks.

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2004-03-17 : 14:41:47
You will also want to check BOL

Here is what I use

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

Jim
Users <> Logic
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2004-03-18 : 00:25:27
This is a formatting issue, and is handled much better at the presentation layer. While it is possible to use SQL to format dates, it usually ties you down to a single format. It should really be a snap to do (and more appropriate) in your reporting tool, whether its Crystal, ASP or Access.

OS
Go to Top of Page

Frank Kalis
Constraint Violating Yak Guru

413 Posts

Posted - 2004-03-18 : 02:32:02
If you are only concerned with displaying the data, that is indeed better handled at the client. However, if you want to do this in TSQL, you'll find several ideas here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=33116


--Frank
http://www.insidesql.de
Go to Top of Page

Lemmy44
Starting Member

20 Posts

Posted - 2004-03-18 : 15:50:20
Thanks for the tips. I'll give them a go and see how it works out.

Thanks again.

Lem
Go to Top of Page
   

- Advertisement -