Truncate strings

Results 1 to 3 of 3

Thread: Truncate strings

  1. #1
    Join Date
    Dec 1969

    Default Truncate strings

    We are trying to update a database row by putting all the column values in textfields, making the changes and then submit the changes to the database.<BR><BR>The problem is that it in some fields add a blank space, even though its bigger than the max size. Any ideas how to solve the problems, maybe truncating or something else, thankful for help.<BR><BR>rgs<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Trim() function?

    The Trim() function will allow you to trim blank spaces from a string.<BR><BR>If you want to truncate to a given number of characters, then you could use a combination of the Left() and Len() functions.<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default RE: Trim() function?

    You might also want to use varchar in your SQL column definitions if you haven&#039;t already done so. Grandma told me that if you use char, the DB automatically pads out the string with spaces. For example, if you had the Name field set as char(5), then "Man" would be stored as "Man ".<BR><BR><BR>I used to be 8 years old once.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts