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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QBE: Between - And

Status
Not open for further replies.

phparadis

Instructor
Nov 1, 1999
13
0
0
CA
I have been attempting to set up a query to search an alpha-numeric column.&nbsp;&nbsp;All values start with alpha values.&nbsp;&nbsp;I want to retrieve a range of values. For example, in the criteria row I entered Between &quot;T*&quot; And &quot;z*&quot;.<br>The values returned do not include any values beginning with &quot;z&quot;.&nbsp;&nbsp;There are values beginning with &quot;z&quot;. I tried with just &gt;= &quot;t*&quot; and the z values are returned. I have tried it with a variety of alpha ranges. In all cases the last letter is ignored.&nbsp;&nbsp;&nbsp;Is this a MS Access bug (I know, this is hard to believe) or have I approached it incorrectly?
 
I think you have to look at your between clause again. I see up there you have Between &quot;T*&quot; and &quot;z*&quot;. &quot;T&quot; has a greater ASCII value than &quot;z&quot;. Therefore the query might not return the lower case &quot;z&quot;. Check it out again with both lower or upper.
 
Because wildcard characters, such as *, are treated as literals, you cannot use them with the Between...And operator. Pretty sure you have to do it this way.<br><br>Not Between &quot;A*&quot; And &quot;S*&quot;<br>
 
Thanks for the feedback. I found Like is the better tool. In the criteria row Like &quot;[T-Z]*&quot; returns all values <b>including</b> those that begin with &quot;T&quot; and &quot;Z&quot; and all others in between.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top