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
Layout Suggestions
SBS 2008 Console Querying Security Status
How do I retrieve text from a website
XP SP3 - Unmitigated Disaster
Pass the current form name to a function within a module
Rolling back transactions in Access (using ADO, DAO, Access code, whatever)
more than 3 conditions for conditional formatting
Usa an Acrobat PDF as a Document Library Content Type Document Template
SQL Syntax
Login box keeps coming up in Outlook 2007 using Exchange 2007