Alpha Split
am 22.02.2006 16:57:23 von Bryan Harrington
I'm working on an app that I need to be able to filter a recordset with an
alpha split.
i.e., give me all customers with lastnames between A - M
So.. that's not a problem.. and customer_name like '[a-m]%' It returns
what I need....
PHB wants to expand that functionality to split the workload up some more..
i.e., give me all customers with last names between L - Mc.. modifing the
same sql as above doesn't work.. I end up with L-M inclusive and some C's
too
Is there a way to get L-Mc inclusive? Or take it a step further.. what
about something like Mc-OL?
Using ASP classic and SQL 2000
thanks
Re: Alpha Split
am 22.02.2006 17:12:31 von rdanjou
"Bryan Harrington" wrote in message
news:%23OLxXj8NGHA.740@TK2MSFTNGP12.phx.gbl...
> I'm working on an app that I need to be able to filter a recordset with an
> alpha split.
>
> i.e., give me all customers with lastnames between A - M
>
> So.. that's not a problem.. and customer_name like '[a-m]%' It
> returns what I need....
>
> PHB wants to expand that functionality to split the workload up some
> more..
>
> i.e., give me all customers with last names between L - Mc.. modifing the
> same sql as above doesn't work.. I end up with L-M inclusive and some C's
> too
>
> Is there a way to get L-Mc inclusive? Or take it a step further.. what
> about something like Mc-OL?
>
>
> Using ASP classic and SQL 2000
>
> thanks
One solution:
and customer_name >= 'L' and customer_name < 'Md'
Or:
and (customer_name like 'L' or customer_name like 'Mc')