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
Running SQL server DTS with condition check
One question about Log4Net & Common.Logging
t-sql update from ambiguous column name
AD Replication, DCDIAG errors... HELP!!!
Adobe Acrobat 9 - forms and email submit button
printing on roll paper in vb.net
How to use SOAP in IIS
Rename local Administrator user for all machines in the Domain
Memory Error crashing VB.NET application
SQL Select query with Case when creating a frequency distribution