
February 9th, 2001, 01:52 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 23
|
|
|
<i><b>Originally posted by : Ajit Anand (ajitanand@usa.net)</b></i><br />Hi!<br /><br />What you have done is, that you have restricted the resultset only to those that exactly match the search criteria. In the prev. query you were using a like clause, which says :<br /><br /> select * from table where name like '%%value%%';<br /><br />It would fetch records like '12value12', '01value10', 'abvalueaa', 'value', 'novalue',<br />and many permutaions and combinations, i.e. replacing the '%' signs with all possible characters(including empty character '' and blank spaces ' '). This means if your db has records which are at 5 - 9 characters <br />(length('value') + 4 '%' signs = 9 characters) and has the string 'value' in between the records are selected.<br /><br />Now your query is something like :<br /><br /> select * from table where name = 'value';<br /><br />It will fetch only one record that will match the strings with an exact value of 'value'.<br /><br />If my point is not clear you may E-mail me so that I can elaborate more on this...<br />Bye!<br />-Ajit<br /><br /><br /><br /><br /><br /><br />------------<br />Nicolas at 2/5/2001 11:48:10 AM<br /><br /><br />Hi,<br /><br />Usually, to find a recordset on databases I use a "SQL - LIKE" statement like this :<br /><br />mysql = "SELECT * FROM [abonnement] WHERE theme LIKE " & guil & pad & oForm("domaine") & pad & guil & ";"<br /><br />with : <br /> guil = Chr(39) ie ' <br /> pad = "%%"<br /><br />and it works very well. But now, I would like to change the statement like this :<br /><br />mysql = "SELECT * FROM [abonnement] WHERE theme = '" & oForm("domaine") "';"<br /><br />and the statement doesn't work at all.<br /><br />Is there someone than can help me ?<br /><br />Thanx in advance<br /><br />Nicolas<br />------------------------------<br />Nicolas Billaudé<br />http://www.nicolasbillaude.com
|