Re: Help with select/between
Posted in 1996
tammy@scooter (Tammy Croteau) wrote: >In a table I have the following data: >AGCR >AGST >ALAR >ANGE >AVSA >AXXA >BRAM >The user wants to wildcard select to get different variations of >data. If they enter in A*-AV* they expect to get the first 5 items >on the list. >My sql statement is as follows: >select <field_name> from <table> where <field_name> between "A*" and "AV*" >The problem is that all data up to (but not including) AV* is returned. The >only way I have found to get the AV* data is to include a matches AV* clause >on the end of the statement. >Is there a better way?????? Any help is much appreciated! Note that "*" is ASCII 42 (0x2a) which is less than all letters. If they wish to include "AVxxx" then they should enter "AW*" or perhaps "AV}" since "}" is ASCII 125 (0x7D) which is greater than all letters. Hope this helps.