I have a date field in one of my files and the date is formatted in the YYYYMMDD
format. I have to extract
the week
from the particular date
value present in my file. How can I do this using SQL?
FYI, I am using IBM DB2.
Sorry, you do not have permission to ask a question, You must login to ask a question.
Sorry, you do not have permission to ask a question.
We can
extract
theweek
from aYYYYMMDD
formatteddate
using theweek()
function andsubstr()
function. Please use the below SQL query to achieve this.or you can simply run the SQL query to test one of the values using a dummy table.
The output
week is 37
.