Hi ,
I am trying to capture week numbers ( 1/1/20 being week 1 and 31/12/20 being week 52). This is so i can report breakdown time on a week to week bases and then display in a chart for, lest say 10 week and then see a trend.
I have tried the DATEPART command but with no success.
Any suggestions?
select JT_TASK_UIV.STATE, JT_TASK_UIV.TASK_SEQ, JT_TASK_UIV.ACTUAL_OBJECT_DESCRIPTION, JT_TASK_UIV.REPORTED_DATE, JT_TASK_UIV.ACTUAL_FINISH, JT_TASK_UIV.ERROR_TYPE, JT_TASK_UIV.PERFORMED_WORK, JT_TASK_UIV.SITE, JT_TASK_UIV.ITEM_CLASS_ID, JT_TASK_UIV.ACTUAL_START, JT_TASK_UIV.ACTUAL_OBJECT_ID as "Serial Object", JT_TASK_UIV.PRIORITY_ID, JT_TASK_UIV.DESCRIPTION, EQUIPMENT_SERIAL_UIV.MCH_CODE, EQUIPMENT_SERIAL_UIV.MCH_LOC, EQUIPMENT_SERIAL_UIV.MCH_POS, DATEPART (wk, JT_TASK_UIV.ACTUAL_FINISH) AS week
from &AO.JT_TASK_UIV LEFT OUTER JOIN &AO.EQUIPMENT_SERIAL_UIV ON &AO.JT_TASK_UIV.ACTUAL_OBJECT_ID = &AO.EQUIPMENT_SERIAL_UIV.MCH_CODE
WHERE STATE IN ('Work Done','Finished','Released','Started','FaultReport','Work Started')