March 10, 2013 at 7:04 pm
I HAVE A TABLE WITH THREE FIELD
COMCOD SIRCODE SIRDESC
3305 180001 KARIM ENTERPRISE
3305 180002 RAHIM ENTERPRISE
3305 180003 JASON G STORE
DATE TYPES COMCOD nchar(4), SIRCODE nvarchar(6) PRIMARY KEY, SERDESC nvarchar(250).
I LIKE TO UPDATE ONLY SIRCODES TO START WITH 19 WHERE SIRCODE FROM THE LEFT STARTED WITH 18 THAT IS NEW TABLE WILL LOOK LIKE
COMCOD SIRCODE SIRDESC
3305 190001 KARIM ENTERPRISE
3305 190002 RAHIM ENTERPRISE
3305 190003 JASON G STORE
March 10, 2013 at 7:22 pm
SELECT
COMCOD
,STUFF(SIRCODE,1,2,'19') AS SIRCODE
,SIRDESC
FROM
[YourTable]
WHERE
LEFT(SIRCODE,2) = '18'
Viewing 2 posts - 1 through 1 (of 1 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