![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to create a string using the week number and year of a date. For instance, if i have a date of 1/3/2007, which would be week 1 of 2007, i want to create a string that says 'Wk1-200707'. i know it's basically 'WK' + CAST(DATEPART(WK,'1/3/2007') AS VARCHAR) + '-' +CAST(DATEPART(YEAR,'1/3/2007') AS VARCHAR) but it's not quite working for me. Any idea of what I'm missing? |
#3
| |||
| |||
|
|
I want to create a string using the week number and year of a date. For instance, if i have a date of 1/3/2007, which would be week 1 of 2007, i want to create a string that says 'Wk1-200707'. i know it's basically 'WK' + CAST(DATEPART(WK,'1/3/2007') AS VARCHAR) + '-' +CAST(DATEPART(YEAR,'1/3/2007') AS VARCHAR) but it's not quite working for me. Any idea of what I'm missing? Thanks in advance. Richard Garth |
![]() |
| Thread Tools | |
| Display Modes | |
| |