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 

huynhtl
Posting Yak Master

107 Posts

Posted - 2008-06-05 : 13:22:15
I want to keep the month name from Jan 2007(servicemonth), but can't seem to remember how. I only need the Jan, not the 2007 part. Please help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-05 : 13:24:52
Use the DATENAME function if your datetype is datetime.

You could alternatively use the MONTH function if you'd like the numerical representation of the month.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

huynhtl
Posting Yak Master

107 Posts

Posted - 2008-06-05 : 13:27:35
can give me an example?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-05 : 13:33:04

1 If you want to show them in front end application, then format it there
2 Select select convert(varchar(3),getdate(),109)


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -