Query to Delete Timesheet messages on PWA Home

insert  MSP_WEB_WORK_APPROVAL(
WASSN_ID,
WRES_ID,
WPRD_START_DATE,
WPRD_FINISH_DATE,
WRES_ID_APPROVER,
WAPPROVAL_STATUS,
WAPPROVAL_NOTIFICATION_SENT)
SELECT WASSN_ID,
WRES_ID,
WPRD_START_DATE,
WPRD_FINISH_DATE,
WRES_ID,
1,
0
FROM MSP_WEB_ASSIGNMENTS MWA, MSP_WEB_TIME_PERIODS mwp
WHERE Not Exists (select * from MSP_WEB_WORK_APPROVAL
where CONVERT(VARCHAR, CONVERT(DATETIME, WPRD_START_DATE), 110) = CONVERT(VARCHAR, CONVERT(DATETIME, MWP.WPRD_START_DATE), 110)
  AND CONVERT(VARCHAR, CONVERT(DATETIME, WPRD_FINISH_DATE), 110) = CONVERT(VARCHAR, CONVERT(DATETIME, MWP.WPRD_FINISH_DATE), 110)
  AND WASSN_ID = MWA.WASSN_ID
  AND WRES_ID = MWA.WRES_ID)

Go

UPDATE MSP_WEB_WORK_APPROVAL
SET WAPPROVAL_STATUS = ‘1’
WHERE WAPPROVAL_STATUS = ‘0’

go

Leave a Reply

Enter the CAPTCHA * Time limit is exhausted. Please reload CAPTCHA.