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 2005 Forums
 Transact-SQL (2005)
 Date Format Question

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2007-11-19 : 10:09:25
Hi

I have a group of dates, and I just need a way of retrieving the day and month of the date.

Does anyone know how to do this?

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-19 : 10:10:56
use datepart(day, yourdatecol) and datepart(month, yourdatecol)


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2007-11-19 : 10:14:52
Hey

Thanks, do you know how I would get the month name to show aswell?

Thanks
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-19 : 10:16:38
[code]datename(month, yourdatecol)[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-19 : 10:17:35
Do you know what is Books On Line ? try refer to it.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2007-11-19 : 10:26:29
Thanks
Go to Top of Page
   

- Advertisement -