March 6, 2017 at 3:21 am
Hi All,
SELECT Timesheet_Number, Employer_Ref, Personnel_Ref, Division, Department, Job_Location, Tax_Year, Tax_Period
FROM Timesheets
WHERE (Timesheet_Number LIKE 'EPCB%')
This returns 1000 timesheet numbers starting with 'EPCB' (Example number is 'EPCB066166')
I want to change the 'EPCB' at the start to read 'HPCB' instead. (Result number would be 'HPCB066166')
How do I do this please?
Thanks
Emma
March 6, 2017 at 3:32 am
UPDATE Timesheets
SET Timesheet_Number = STUFF(Timesheet_number,1,4,'HPCD')
WHERE Timesheet_Number LIKE 'EPCB%'
Make sure you understand what the STUFF function does before you use this in production. You're the one who'll be supporting it, so you need to know how it works!
Edit - corrected typo in code
John
March 6, 2017 at 3:51 am
Thank you for your help, I will research STUFF now
Thanks
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy