Well, I tested this and it works fine on a 2k db NOT running in compatability mode, so that is the issue. Now to find a workaround.
-----Original Message----- From: John Stanley Sent: Friday, February 04, 2005 11:35 AM To: CF-Talk Subject: OT:SQL Replace Question Anyone have any idea why this code will not strip out the spaces in the string "N0P 2L0"? select Replace(postal_code,' ', '') from location where id = 1009637 when I change the last argument to 'X' it throws two X's in like it should. We are running ms sql 2k in 6.5 compatibility mode, so I dont know if that is the reason why it wont trim the spaces out. If this is why, does anyone have a workaround that would work inside a join clause like oin zipinfo z on Replace(z.zip,' ','') = Replace(l.postal_code,' ','') when running in compatibility mode? TIA John ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193119 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54