October 12, 2009 at 2:15 pm
Hi All,
Not sure if this can be done in T-SQL but I was curious if there is a way to filter on a range based on the the first letter in the last name. So basically I want to get everything where the last name between A and M. then N and Z. Something like:
WHERE P.LAST_NAME BETWEEN LIKE 'A%' AND LIKE 'M%'
Of course this doesn't work, but just wanted to show what I'm attempting to do.
Thanks,
Strick
October 12, 2009 at 2:24 pm
October 12, 2009 at 2:26 pm
Try this:
select * from person.contact where LastName like '[A-N]%'
Regards
Piotr
...and your only reply is slàinte mhath
October 12, 2009 at 3:21 pm
Great! thanks guys
Strick
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply