var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: ISNUMERIC() in LIKE statement
Here's the problem:
I need to search a postcode database by the first one or two letters.
Problems occur for example when i want to search north London postcodes (N) when using:
postcode LIKE @postcode + '%'
As this picks up everything beginning with N, eg, NG for Nottingham, or NE for Newcastle. So i need a like statement which searches for the first one or two digits followed by a number!
I've found the ISNUMERIC() function but not sure what the best way to use it with the like statement - or even if there is a better way altogether - can you use regular expressions in MSSQL?
Last edited by mattock; 01-10-07 at
SET @postcode = 'N[0-9]%'
ur codings are working excelent.
yup, that works, i ended up using:
WHERE postcode LIKE @region + '[0-9]%'
I know [0-9] certainly looks like a regex, is it(?) just a simple case of putting in your regex into a statement like that? Do you know of anywhere there's a list of regex operator types i can use in MSSQL if this is the case?
it's not true regex
thats spot on....i thought it was a bit weird having the wildcard (%) symbol - hadn't seen it before in any regex i've done.