I want to trim the characters from the left in my SQL value:
I have the following value:
ABC0005953
How do i trim the value 3 character
SELECT SUBSTRING('ABC0005953', 4, LEN('ABC0005953'))
Start at the fourth character and keep going.
(Just posting as an alternative to the RIGHT(...)
solution.)
In response to your update, I assume you mean you want to apply the above to your table:
SELECT SUBSTRING(TABLE.VALUE, 4, LEN(TABLE.VALUE))
FROM TABLE
From your other question:
I have the following:
SELECT DISTINCT
Left(GIFTHEADER.pID + GIFTHEADER.PID + '-' + Cast(PAYMENTDETAIL.PLINENO as Varchar),18)
AS TRANSACTIONREF...
Currently my value looks like this:
ABC0005953ABC0005953
I want to simply strip off the first 4 characters from GIFTHEADER.pID
If you want to remove the first four characters from GIFTHEADER.pID
, I would recommend removing them before putting the value into your combined string:
SELECT DISTINCT
LEFT(SUBSTRING(GIFTHEADER.pID, 5, LEN(GIFTHEADER.pID) +
GIFTHEADER.PID +
'-' +
Cast(PAYMENTDETAIL.PLINENO as Varchar),18)
AS TRANSACTIONREF