I have created a select query:
SELECT a.STAFFNO,a.REGION,a.DEPARTMENT,
LEFT(REGION,3) AS REGCODE,
LEFT(DEPARTMENT,4) AS DEPTCODE,
(DEPTCODE+REGCODE) AS ACCODE,
(DEPTCODE+REGCODE) AS COSTCNTRE
FROM ELYOSERVICESTEST.dbo.MASTER a
WHERE STATUS = 'Active'
I want to change this so that it updates the REGCODE,DEPTCODE,ACCODE and COSTCNTRE fields every night but am not sure how to change the code to do this.Can anyone help?
SELECT a.STAFFNO,a.REGION,a.DEPARTMENT,
LEFT(REGION,3) AS REGCODE,
LEFT(DEPARTMENT,4) AS DEPTCODE,
(DEPTCODE+REGCODE) AS ACCODE,
(DEPTCODE+REGCODE) AS COSTCNTRE
FROM ELYOSERVICESTEST.dbo.MASTER a
WHERE STATUS = 'Active'
I want to change this so that it updates the REGCODE,DEPTCODE,ACCODE and COSTCNTRE fields every night but am not sure how to change the code to do this.Can anyone help?