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
 General SQL Server Forums
 New to SQL Server Programming
 Trim()

Author  Topic 

jgrant
Yak Posting Veteran

69 Posts

Posted - 2007-03-16 : 13:32:13
Okay basic question from the village idiot. How do I return only the date and not the time from a datetime column and also can I return only a set number of digits in a float column?

Thanks in advance peter

The Yak Village Idiot

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-16 : 14:00:33
1) DATEADD(DAY, DATEDIFF(DAY, 0, Col1), 0)
2) CAST(FloatCol AS NUMERIC(10, 6))


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-16 : 14:11:32
Well, that's 2 questions...but the first one is

CONVERT(varchar(10),GetDate(),101)

And the second, I have no idea until you provide examples....

Read the hint link in my sig



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-16 : 14:12:32
...and to be clear, we already have a village idiot



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -