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
 convert date

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-12-15 : 14:26:41
As an extension to my last post, the segment of this select which deals with [Date Created]:
SELECT datecreated as [Date Created], ROWS AS Rows, reserved AS Reserved, DATA AS Data, index_size AS [Index Size], unused AS Unused FROM dbtablestats WHERE NAME = 'AuditLogRow'
pulls the date from the source as "DD/MM/YYYY 00:00:00". I would like the result in the select to only be "DD/MM". What is needed in the select to convert the date to that format in the select results?

thanks

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2011-12-15 : 14:41:55
Maybe it would amke more sense to post in your other thread so the details are one place instead of spread across threads?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-12-15 : 15:20:40
Look up cast and convert in BOL

AND

YEAR() and MONTH()



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


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -