By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,160 Members | 1,029 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,160 IT Pros & Developers. It's quick & easy.

Creating query which uses first letter of last name as a range

P: 2
Hi everyone,

Apologies in advance as I'm somewhat of a novice with Access. I use an Access project (2002 SP3) via XP and am trying to create a query which will show me a range of last names beginning wiht the first letter. The results I want to see are where last name = A through K, for example, so that it only returns records with last names begininning with these letters. Any ideas as to how the criteria should be written? Thanks!
Dec 2 '06 #1
Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,660
Expand|Select|Wrap|Line Numbers
  1. SELECT Blah Blah Blah
  2. FROM Table
  3. WHERE (Left([LastName],2) Between 'A' And 'KZ')
Dec 3 '06 #2

P: 2
Thanks a lot. Worked like a charm!
Dec 3 '06 #3

NeoPa
Expert Mod 15k+
P: 31,660
You're welcome - pleased to have helped :).
Dec 3 '06 #4

ADezii
Expert 5K+
P: 8,669
Hi everyone,

Apologies in advance as I'm somewhat of a novice with Access. I use an Access project (2002 SP3) via XP and am trying to create a query which will show me a range of last names beginning wiht the first letter. The results I want to see are where last name = A through K, for example, so that it only returns records with last names begininning with these letters. Any ideas as to how the criteria should be written? Thanks!
'If you are doing this from the Query Grid then in the Criteria Row of the Query
'Grid for the desired Field, type Like "[A-K]*" as the criteria
Dec 3 '06 #5

NeoPa
Expert Mod 15k+
P: 31,660
'If you are doing this from the Query Grid then in the Criteria Row of the Query
'Grid for the desired Field, type Like "[A-K]*" as the criteria
This is a MUCH better answer (Thank you ADezii).
Expand|Select|Wrap|Line Numbers
  1. SELECT Blah Blah Blah
  2. FROM Table
  3. WHERE ([LastName] Like '[A-K]*')
Dec 3 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.