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
Accessing application component in .net
Alitris Deployment Solution
Remote desktop freezes host computer and stops at HP splash screen on remote computer
getting the hwnd or dc for access form
How do I display a login banner for RDP users?
select only uppercase words from a table column
For Experts: Obfuscated Access Contest
Exchange 2003 Cluster, Event ID: 1080 occurs every three seconds
Windows 98 Splash Screen (logo) freezes during bootup
STOP: 0x00000007B (0xF7B44528, 0xC0000034, 0x00000000, 0x00000000)