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
SBS 2008 - Connect Wizard Won't Migrate Profile
How to configure VPN access on SBS 2008
The MAPI call 'OpenMsgStore' failed with the following error, mailbox store cannot be accessed
one continuous page and want no page breaks
E-mail addresses missing from Outlook cache
MS SQL Server 2008 Express modifying field sizes
There is not enogugh memory to complete the automation object operation on the chart object
read xml object
Putting a variable into SQL
Multiple Asset tracking per month / Per year