175 pts.
 Trimming Values with SQL Server Express 2005
I have a column whose values range from 10-15 characters and whose last 7 characters I would like to get rid of. Can someone please show me how to do this? I thought it would be RTRIM but that didn't work for me. I can't use LEFT or RIGHT before the column because the column length is variable. I would appreciate any help. Thanks much. So here is an example of what I want to accomplish below:    
PROBLEM EXAMPLE: 12345678.HELLO
FIXED EXAMPLE: 12345678


Software/Hardware used:
SQL Server 2005 Express
ASKED: June 28, 2010  6:40 PM
UPDATED: June 29, 2010  5:55 PM

Answer Wiki:
Try: <pre>left(<field>, len(<field)-7)</pre> This will discard the right-most 7 characters.
Last Wiki Answer Submitted:  June 29, 2010  5:42 pm  by  Kccrosser   3,830 pts.
All Answer Wiki Contributors:  Kccrosser   3,830 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Beautiful! This worked perfectly. Thank you. I was initially creating a function for this but this is a lot simpler.

 175 pts.