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

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
Utf
3/31/2010 7:17:01 PM
access.queries 6343 articles. 1 followers. Follow

4 Replies
3037 Views

Similar Articles

[PageSpeed] 45

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
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
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
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
John
3/31/2010 9:37:30 PM
Reply:

Similar Artilces:

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

Excel user name
A while ago there was a thread here asking about excel user names - cant find it now but id like to know how i can create a MSGBOX that ca use names - for example the macro reads the excel user name, vlookup short (nick) name, then gives a more personalised message. Can anyone help? Thank -- Message posted from http://www.ExcelForum.com Hi msgbox application.username -- Regards Frank Kabel Frankfurt, Germany "LB79 >" <<LB79.1axkrc@excelforum-nospam.com> schrieb im Newsbeitrag news:LB79.1axkrc@excelforum-nospam.com... > A while ago there was a thread here askin...

automatically replicating my first page.
Ok, I'm creating a basic table for recording data. I have the page set up exactly how I want it...now, what I need it to do is when I fill all the cells on the first page and activate a second page it gives me an exact copy of my original page, with obviously just page number changed in the footer. I don't want to have to mess around with recreating the form every time I fill a page in. Hi Rusty, Your comment "what I need it to do is when I fill all the cells on the first page and activate a second page it gives me an exact copy of my original page". Do you mean pa...

Command Buttons Not Responding on First Click
Using Access 2003. Very simple, I have a command button to close the form. Code is as follows (form is called "Select212Form") Private Sub btnMenu_Click() On Error GoTo Err_btnMenu_Click DoCmd.Close acForm, "Select212Form" Exit_btnMenu_Click: Exit Sub Err_btnMenu_Click: MsgBox Err.Description Resume Exit_btnMenu_Click End Sub The button does nothing the first time it's clicked. Next time, I click it, it works! It's not a double-click, there is a pause between clicks. If I put a breakpoint in there, it enters the routine on the first click ...

Count uniq records and assign to a control
SID is the field of underline query of a form (have many duplicates). I want to count number of uniq SID and assign the result to TotalStudent control on the form. Please help. Thanks - Song In article <e90AFyUbHHA.1388@TK2MSFTNGP05.phx.gbl>, csitnnn@hotmail.com says... > SID is the field of underline query of a form (have many duplicates). I want > to count number of uniq SID and assign the result to TotalStudent control on > the form. Please help. Thanks > > - Song > > > Maybe with a saved query such as Query1: SELECT DISTINCT SID FROM UnderlyingQ...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

Set Records Per Page Default
Hi, I'm new to CRM (version 4.0) and have been asked by the boss if it is possible to default the "records per page" option to 250 for all new users rather than the usual 50. I've been through three books now (Microsoft Dynamics CRM 4 for Dummies, Step by Step Microsoft Dynamics CRM 4.0 and Working with Microsoft Dynamics CRM 4.0) and while they all mention that 50 is the default, none of them mentions a way of changing that. Does anyone here know of a way of changing the default? Thanks, Tony. As far as I know there is no default setting for all users. -- htt...

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

named excel lists
I'm somewhat of a newbie, so I may not be asking this question with the correct terminology. I'd like to define a name and attach it to the range of an "excel (2003) list". If I add a new row or column to the "excel list", then the range is suitable extended. How? Try Debra Dalgleish's nice coverage of Dynamic Ranges at: http://www.contextures.com/xlNames01.html#Dynamic Look for "Create a Dynamic Range" -- Rgds Max xl 97 --- Please respond, in newsgroup xdemechanik <at>yahoo<dot>com ---- "hidden" <hidden123456@hotmail.com...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Category Name Mods at Runtime
Creating a template to use with basic chart but when certain Xaxis labels contain specific values that might show in certain data sets, I'd like to either change the font color or use the interior colorindex property. In other words, a 1 b 2 c 3 But when the category values are displayed - I'd like the letter b to be in blue. I'm already scanning the data and modifying the color of the datalabel font and the correlated bar chart but wanted to also change the category label. Thanks in advance... Any chance this property is available? You can't format axis la...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

Have Stores Create Records in HQ
Is it possible to have the stores databasse create records in the HQ dbase and not the other way around? For eg. Sometimes clients forget when they get new products to create it in HQ then send out to stores. Merci We have a utility to allow you to create an item simultaneousely at store and in HQ. Contact m efor more detail. Afshin Alikhani - [afshin@retailrealm.co.uk] CEO - Retail Realm "SIDSolutions" wrote: > Is it possible to have the stores databasse create records in the HQ dbase > and not the other way around? For eg. Sometimes clients forget when they get &g...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

programatically insert record
I have a many to many relationship between security clearances and billets. a clearance can be associated with more than one billet and a single billet can be associated with many clearances. That; however, may not have anything to do with my problem. I've built a form that has a listbox that displays the assocaited billets for an employee's clearance. Next to it I put a drop down list box that looks up the list of billets and stores it's value for later use. I've then added an "add" button underneath the drop down list box. What i'd like to do is cho...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

Link select with a blast
I have Win 7 Home Premium, x64. Quite often, when I select a link, a mouse pointer changes to a palm with a blast. I understand, the palm is the standard mouse pointer for link select, but what is the blast? What it indicates? -- Ilya Zeldes Fort Myers, Florida Hi Ilya, I suspect that this is being caused by a tracking program. Run something like Ad-Aware and see if it indicates a tracking company. If so, you can delete it, however, it might prevent you from accessing that particular website. Dave "Ilya Zeldes" wrote in message news:7A6FF9B1-5512-44...

Deleting duplicate records 01-21-10
I populated a table using an Append query. I created a duplicate records query using the Wizard. There are 20000 records. Now I need to delete the duplicates out of this query. How do I do that? this may be a duplicate post, im not seeing my first one. anyways, instead of deleting those duplicate records, lets just grab all the records that are not duplicates. (an unmatched query). do a LEFT JOIN from your main table to your duplicate table/query on primary keys. Choose your primary key from the DUPLICATE table, and set the criteria to Is Null. This will pull ALL Recor...

How to revert back to the original file name in a hyperlink
I have an excel file with 2500 linked objects in it. All the linked objects are given with a name for eg. "SCAN". I want to change these names in the "test to display" column for all the cells in one go. Is it possible ? ...

How to change the the attribute's name???
Hi Group: I would like to know if it is possible to change the name of an attribute to something else. My setup is like this: I have serveral SQL tables that I nest and join so that it all outputs into a nice XML file for the purpose of populating a flash navigation menu. <NewDataSet> <mainMenu_category menu_name="Home" menu_ID="1"> <menu menu_ID="1" /> </mainMenu_category> <mainMenu_category menu_name="Product" menu_ID="2"> <menu category_name="28.5 Volt DC Power Carts" menu_...

Several questions from first time user
I am a first time user of Money (or for that matter any finance software). Have the following questions. I am using Money 2007 Premium on Windows XP Pro SP2. 1. How do I change the background color from the default white. My eyes start irritating within half an hour of working on a software application that has white background. Money 2007 is not honoring the color schemes already set in Windows XP and IE7 on most pages. (On the online pages where it pulls information from a website directly, it is using IE itself, so obviously honors the color scheme there!) I found the followi...

Stop named ranges being copied
I want to copy a worksheet from one workbook to another. But I do not want to copy the named ranges associated with the first workbook to the second. How do I prevent named ranges being copied when I move sheets. >>How do I prevent named ranges being copied when I move sheets. You can't. A named range is just as much a part of a sheet as anything else. Delete the name(s) after you copy a sheet. -- Jim <bmatheson@gmail.com> wrote in message news:1183722346.818571.213860@q75g2000hsh.googlegroups.com... >I want to copy a worksheet from one workbook to another. > >...

No customer record exists for this customer ID
This message came up during the posting process. Why did SOP allow the invoice to be created? A few questions: 1. Does the Customer ID actually exist? 2. Is there a possibility that the customer record was physically removed, say with a T-SQL DELETE statement *after* the SOP transaction record was created? 3. Is there a possibility that the customer's Customer ID was accidentally updated with a T-SQL UPDATE statement *after* the SOP transaction record was created? If the customer record is missing, I would restore the last known good backup into a test environment, then transfer ...

Counting number of records based on criteria
Hello, (Try again to get the question in the google-groups. Perhaps not pushed on the send button). For counting records as expression in a report in ms.access I'm using =count(*) which shows all records. Now I also want to know how many of them has registered a specific data in a specific field. I'm trying to use =count([Field1]="999") to count how many of the selection reported has registered data 999. This option isn't work. Can somebody give me the correct solution. thanks, Johan The 999 needs to go in the criteria for the query driving the...