View Full Version : TRIM function?

04-09-2007, 10:03 PM
Heres the situation:

In my column in the database, the value is either "NEW" or "NEW "....notice the 2 extra spaces at the end...so when I do a condition check, it works for those tht have "NEW" btu doesnt if its "NEW "

Is there some TRIM function to get rid of the 2 spaces when they appear...

mysql="SELECT * FROM Test WHERE number='10'"
Set rs= Con.Execute( mySQL )

if rs("status")="NEW" then
end if

A silly fix that I did is just put an or rs("status")="NEW " in it...any better ideas???

04-10-2007, 06:09 AM
You already mentioned it.

if Trim(rs("status"))="NEW" then

04-10-2007, 03:55 PM
Thanks works like a charm:

So Trim(string) removes spaces on both sides of a string...good info:)

04-10-2007, 09:05 PM
Yeah, Trim(String) removes spaces on both sides of the string. LTrim(String) trims the left side and RTrim(String) the right side.

04-18-2007, 02:24 PM
Just for reference

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum