You can't use a wildcard in an IN list -- expanding an in is like this:HomeTelephone in ('01%', '02%', '07%') Is equivalent toHomeTelephone = '01%'OR HomeTelephone = '02%'OR HomeTelephone = '07%'
You need to use LIKE insteadSo you can do this:and ( HomeTelephone LIKE '0[127]%' or indivMobileNo LIKE '0[127]%' )
The square brackets match exactly one of the allowed characters inside.So those LIKE conditions areAny string starting with 0 and second character one of (1,2,7) and then anything else for the rest of the string.Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION