Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select last name between

Status
Not open for further replies.

mcauliff

Programmer
Feb 26, 2007
71
US
What is the best way to code for selecting the row that have last names between 'a' and 'm'?

There are multiple columns in the query. It will be used in a spreadsheet and currently returns on the row limit of 65536 rows. I want to break it into selecting a through m and n through z.

I tried < 'n', but the results was not what I expected.
 



hi,
Code:
Where SubStr([last name],1,1) Between 'a' and 'm'


Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



BTW,

Since your results are going to end up in Excel, why not use MS Query in Excel and query the DB2 database directly?

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thank for the reply. I am using the query function in Excel. I usually that function for quick tasks and code a program for others.

Not an option to upgrade to Office 2007.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top