tuzojazz Posted August 25, 2006 Share Posted August 25, 2006 Hi:suppose I have this tableCUSTOMERS---------------------Name---------------------JohnGabrielGeorgeKenI need to make a query to get customers where the Name length is equal or greater than 6Name--------------------GabrielGeorgeHow Can I make this query or/and where can I find information about this kind of query?Thanks!! Link to comment Share on other sites More sharing options...
reportingsjr Posted August 25, 2006 Share Posted August 25, 2006 <?php$query = "SELECT * FROM `customers`";$result = mysql_query($result);while($row =mysql_num_rows($result){ if(strlen($row[0]) > 6){ //do whatever, like echo the name or do what you want }}?> Hopefully this will help you Link to comment Share on other sites More sharing options...
skym Posted August 25, 2006 Share Posted August 25, 2006 SELECT * FROM 'customers' WHERE CHAR_LENGTH(Name)>=6http://dev.mysql.com/doc/refman/4.1/en/string-functions.html Link to comment Share on other sites More sharing options...
tuzojazz Posted August 25, 2006 Author Share Posted August 25, 2006 Hi:Thanks but char_length does not work in access.Is there a function that works in access? Link to comment Share on other sites More sharing options...
aspnetguy Posted August 25, 2006 Share Posted August 25, 2006 use Len() in MS Access and SQL Server Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now