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
Need SQL Script
How Do I download AJAX Futures?
Renaming Tables in Access without affecting desing grid queries
how to remove all spaces in an EXCEL column
How to get COM interface API definitions after importing a type library
Help installing Server 2003 on RAID
How to extract table field list using query
Runtime error 490 and followhyperlink
Excel Automation Paste
no default printer being set for terminal services 2008