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.
Author |
Topic |
EltonSky
Starting Member
2 Posts |
Posted - 2006-10-10 : 21:35:09
|
Hello guys,I have datetime value as "mm/dd/yyyy h:m:s", my question is as title. help pls!Cheers,Elton |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-10-10 : 21:52:07
|
Surprisingly, you can use the Month() function.Select Month(SomeDate)- Jeff |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-10-10 : 22:23:47
|
YOu can use the DATEPART function to get the month number or DATENAME function to get the month name.select datepart(month,Mydate), datename(month,Mydate) CODO ERGO SUM |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-10-10 : 23:59:43
|
quote: Originally posted by jsmith8858 Surprisingly, you can use the Month() function.Select Month(SomeDate)- Jeff
Harsh AthalyeIndia."Nothing is Impossible" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-11 : 10:06:12
|
quote: Originally posted by EltonSky Hello guys,I have datetime value as "mm/dd/yyyy h:m:s", my question is as title. help pls!Cheers,Elton
Make sure you use DATETIME datatypeMadhivananFailing to plan is Planning to fail |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-10-11 : 10:44:33
|
quote: Make sure you use DATETIME datatypeMadhivanan
And do it in the front end! [Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-11 : 12:07:38
|
>>And do it in the front end! Yes when you want to show it in different formats MadhivananFailing to plan is Planning to fail |
|
|
|
|
|
|
|