0

I am trying to remove white space at the beginning and end of an email address as some data that was imported to our server has this at the beginning and end of the string.

I am using the query below to get this to work, however the white space in question is not a space " " but more like a tab or a bigger space. I can't seem to work out what to put in to replace/remove this white space to return the rows that match the email address.

I wan't to avoid using wildcards if possible.

SELECT Ordernumber FROM orders JOIN customers ON orders.CustomerNumber = customers.CustomerNumber WHERE REPLACE(EmailAddress, ' ', '') = 'lewis@test.com'

Any suggestions, email address is a VARCHAR if that helps

Lewis Smith
  • 1,271
  • 1
  • 14
  • 39

0 Answers0