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 |
|
PeeJay2583
Starting Member
40 Posts |
Posted - 2011-06-07 : 02:52:36
|
| I have a Date Column in a table1 as below2010-05-10 00:00:00.0002010-07-22 00:00:00.0002010-07-26 00:00:00.0002010-10-13 00:00:00.0002010-10-13 00:00:00.000I want to use datepart function to get the week numberSELECT DATEPART([DATE],'WW') AS DATE_NEW FROM Table1Getting an error message as belowMsg 155, Level 15, State 1, Line 1'DATE' is not a recognized datepart option.Please suggest. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-06-07 : 03:29:12
|
Read Books Online, the SQL Server help file.SELECT DATEPART(WEEK, [Date]) FROM dbo.Table1 N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|