Yeah - I've run into that too.  That's why its important to trim strings
when inserting them, but I've worked on projects where the data is
pre-existent and that wasn't an option.

-----Original Message-----
From: James Sleeman [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 6:38 PM
To: CF-Talk
Subject: Re: Trim in SQL


----- Original Message -----
From: "Ben Forta" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, March 05, 2002 3:07 PM
Subject: RE: Trim in SQL


> There is no TRIM(), but there is a RTIM() and a LTRIM():
>
> SELECT foo from bar
> WHERE RTRIM(LTRIM(narf)) is like 'blah'

Thanks, unfortunatly it's not quite the same - it only trims spaces (maybe
tabs too, didn't test), not other whitespace like (specifically) CR and LF.
I have done the following instead, but it's a bit hacky...

Replace(Replace(narf, Char(10), ''), Char(13), '')

---
James Sleeman

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to