Alpha Split

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
Bryan Harrington [ Mi, 22 Februar 2006 16:57 ] [ ID #1199657 ]

Re: Alpha Split

"Bryan Harrington" <news [at] whydoyouneedtosendspam.not> wrote in message
news:%23OLxXj8NGHA.740 [at] 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')
rdanjou [ Mi, 22 Februar 2006 17:12 ] [ ID #1199658 ]
Webserver » microsoft.public.inetserver.asp.db » Alpha Split

Vorheriges Thema: Problems retrieving image from SQL server
Nächstes Thema: error '80020009'