Microsoft
Software
Hardware
Network
Question : Remove first 5 characters from SQL
I have an SQL2005 database and I need to remove the first five characters of a field named 'DESC'. I'm getting a syntax error when I try to use this:
UPDATE files
SET [desc] = RIGHT([Desc], len([desc]) - 5)
WHERE (CUSTNO = 02028) AND (tempid = 0080088)
Answer : Remove first 5 characters from SQL
Hello RavenTim,
Based on the leading zeroes I surmise that CUSTNO and tempid are strings, thus:
UPDATE files
SET [desc] = RIGHT([Desc], len([desc]) - 5)
WHERE (CUSTNO = '02028') AND (tempid = '0080088')
Regards,
Patrick
Random Solutions
How to make dropdown disappear using code
should only be 3 records returning 8 in query
Check for existence of index with INFORMATION_SCHEMA?
UCC SSL certificate?
Move mailbox failed from Exchange 2003 to 2007 - Event ID 8507
Bring to the front or send to the back
Sporadic Transaction Log Backup failure
Has anyone run these scripts
Random numbers in VB.net not random...weird?
SMPTE time code input mask not working