472,146 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

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 14754
NeoPa
32,499 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,499 Expert Mod 16PB
You're welcome - pleased to have helped :).
Dec 3 '06 #4
ADezii
8,830 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,499 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 Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.