469,306 Members | 2,477 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

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

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
5 13652
NeoPa
32,173 Expert Mod 16PB
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
kukady
2
Thanks a lot. Worked like a charm!
Dec 3 '06 #3
NeoPa
32,173 Expert Mod 16PB
You're welcome - pleased to have helped :).
Dec 3 '06 #4
ADezii
8,800 Expert 8TB
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
32,173 Expert Mod 16PB
'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.

Similar topics

5 posts views Thread by Got2Go | last post: by
3 posts views Thread by Pakku | last post: by
5 posts views Thread by Rupert Street | last post: by
2 posts views Thread by deja | last post: by
5 posts views Thread by ladybug via AccessMonster.com | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.