Question : return rated results

Good afternoon,
Im looking at a search application, which I would like to return the most popular result at the top.

My idea is to have if I wanted to search 'How do I log into experts-exchange', it splits the question up into each word, then executes it, and rates the returned results.

So for example if there was a record saying 'How do I log into experts-exchange' it would return a score of 7, but if I was to ask 'How do I log into hotmal' it would return a score of 5 (only the 'How do I log into' words match).

I can seperate the words before the execution, and even add it onto the end of the statment, but dont know how to keep a score of which words match.

So for example, I would write the query as:-
select * from questions where `question` like '%how%' or like '%do%' or like '%i%' or like '%log%' or like '%into%' or like '%experts%' or like '%exchange%';

but for each returned 'or' segment correctly returned, I need it to add 1 onto a running total, then I can (hopefuly) ORDER BY 'score'.

Thanks in advance for this

Answer : return rated results

Hi,

you can add in the With statement, like the snippet below

cheers, teylyn
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
With oWS
    FormulaRow = .Cells(.Rows.Count, "d").End(-4162).Row + 2 'xlUp
    .range("c" & FormulaRow & ":f" & FormulaRow).Formula = "=SUM(c2:c" & (FormulaRow - 2) & ")"
    .Cells.Font.Size = 10
    .Rows(1).Font.Bold = True
    .UsedRange.EntireColumn.AutoFit

    .range("H:J").NumberFormat = "0.00%;[Red]0.00%"
    .range("C:F").NumberFormat = "#,##0.00;[Red]#,##0.00"
    End With
Random Solutions  
 
programming4us programming4us