Link to home
Start Free TrialLog in
Avatar of urjudo
urjudoFlag for United States of America

asked on

Alphabet order in access query

Hi Experts,
I have a query question.  my query has a field "Last Name" and sort it by alphabet order from A to Z, how to I do if I just want to pull from L to Z?  I have a field which call Last Name A: Left([LASTNAME],1)

Thanks
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Something like:

SELECT * FROM yourTable
WHERE [Last Name] >= Forms!yourForm.txt_StartLetter
ORDER BY [Last Name] ASC
Avatar of urjudo

ASKER

I just tried to run the query first without any forms, it's pull from tables.  no quite sure if I can use "Forms!yourForm"  what is the txt_startletter?
That SQL assumes you have a form open, and have a textbox named "txt_StartLetter".  Then you would either use the AfterUpdate event associated with that textbox, or a button, to open your query.
Avatar of urjudo

ASKER

I'm trying to create a report, I need to have a query first and I added >= "L" in the criteria of the query, it pull all the letter from L to Z, what about if I just want to pull from L to P?
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of urjudo

ASKER

Thanks!!!