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

How have count of words (in a field) for orderby?

Status
Not open for further replies.

hercule2

Programmer
Nov 30, 2003
12
FR
FROM ASP with access 2000 database :

<%
Set m_Conn = server.CreateObject(&quot;ADODB.Connection&quot;)
m_Conn.Open &quot;eq14CVs&quot;, &quot;&quot;, &quot;&quot;
SQL = &quot;Select TOP 5 [field] as toto from table orderby fct([field],'the_word') desc&quot; ' MyFunc is not permit here
Set rs = m_Conn.Execute(SQL)
Do
If (rs.EOF) Then Exit Do
response.write rs(&quot;toto&quot;) & &quot;<br>&quot;
rs.MoveNext
Loop
%>

I would like to obtain an order with occurence of a word.

Do you know a &quot;fct([field],'the_word')&quot; ?

It is not possible to create and use with ADO a replace function, so i need an another solution.


Example :
fct([field],'the_word') =
(len([field])-len(Replace([field],'the_word','''',1,-1,1)))/len('the_word')


I don't want use the replace function under ASP because the database have 15000 rows to order. It's too big to do with ASP.

Please, help me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top