select records where first letter of name begins with an a through

  • Follow


I'm trying to create a chart but I have too man names. I want to limit the 
query to names that begin with an A through M - then create a separate query 
for names that begin with M though Z. That way, I can have two reports that 
display the data properlly. 

Any idea how I would limit the query data based on the first letter of each 
person's name? I also need to incorporate the greater than / less than 
restriction.

Thanks,
0
Reply Utf 3/31/2010 7:17:01 PM

Try this --
   Between "A" AND "M"

-- 
Build a little, test a little.


"JK" wrote:

> I'm trying to create a chart but I have too man names. I want to limit the 
> query to names that begin with an A through M - then create a separate query 
> for names that begin with M though Z. That way, I can have two reports that 
> display the data properlly. 
> 
> Any idea how I would limit the query data based on the first letter of each 
> person's name? I also need to incorporate the greater than / less than 
> restriction.
> 
> Thanks,
0
Reply Utf 3/31/2010 7:40:01 PM


SELECT Employees.*
FROM Employees
WHERE Left([LastName],1) Like "[A-N]" ;

SELECT Employees.*
FROM Employees
WHERE Left([LastName],1) Like "[M-Z]" ;
-- 
Jerry Whittle, Microsoft Access MVP 
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"JK" wrote:

> I'm trying to create a chart but I have too man names. I want to limit the 
> query to names that begin with an A through M - then create a separate query 
> for names that begin with M though Z. That way, I can have two reports that 
> display the data properlly. 
> 
> Any idea how I would limit the query data based on the first letter of each 
> person's name? I also need to incorporate the greater than / less than 
> restriction.
> 
> Thanks,
0
Reply Utf 3/31/2010 7:41:01 PM

JK <jasonk at necoffeeco dot com> wrote:

>I'm trying to create a chart but I have too man names. I want to limit the 
>query to names that begin with an A through M - then create a separate query 
>for names that begin with M though Z. That way, I can have two reports that 
>display the data properlly. 
>
>Any idea how I would limit the query data based on the first letter of each 
>person's name? I also need to incorporate the greater than / less than 
>restriction.


Use a criteria like this for the name field:
	< "N"
for the first one and:
	>= "N"
for the second one.

-- 
Marsh
MVP [MS Access]
0
Reply Marshall 3/31/2010 7:56:39 PM

Use the following expressions in your query as criteria under the name field.

For a to m use
    LIKE "[A-M]*"

And for n to z
    LIKE "[N-Z]*"

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

JK wrote:
> I'm trying to create a chart but I have too man names. I want to limit the 
> query to names that begin with an A through M - then create a separate query 
> for names that begin with M though Z. That way, I can have two reports that 
> display the data properlly. 
> 
> Any idea how I would limit the query data based on the first letter of each 
> person's name? I also need to incorporate the greater than / less than 
> restriction.
> 
> Thanks,
0
Reply John 3/31/2010 9:37:30 PM

4 Replies
1588 Views

(page loaded in 0.052 seconds)


Reply: