* Craig Shepherd > select * from consumers surname BETWEEN '$surname_from' AND '$surname_to' > > assume $surname_from = A and $surname_to = B > > would only return results where the surname is A or greater but > less than B, but I would like to include all records where records > also start with B.
Append a high ascii value to the $surname_to, like '{', so that your query will be: select * from consumers surname BETWEEN 'A' AND 'B{' -- Roger --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php