|
-
Sep 23rd, 2005, 04:57 PM
#1
Thread Starter
Fanatic Member
Microsoft Indexing Service query by date [RESOLVED]
Set up the Microsoft Indexing Service on our server and created a asp.net page to query. We got it working except for quering the results by a start date and end date.
Has anyone else found if you can query by 'Access'?
My sql is:
SELECT doctitle, filename, rank, access
FROM scope()
WHERE CONTAINS('myterm')
AND (Access > '01/09/05' AND Access < '02/09/05')
ORDER BY Rank DESC
If I take out the AND line it works great but the dates just don't seem to catch the right files. Anyone have any good insight on this?
Thanks.
Last edited by lleemon; Sep 28th, 2005 at 08:05 AM.
-
Sep 23rd, 2005, 06:40 PM
#2
Re: Microsoft Indexing Service query by date
There is a between syntax like this
AND (Access BETWEEN '01/19/05' AND '02/09/05')
also do you know what kind of database it is that you are querying? If it is access I think you need to maybe use # around the date instead of '
I haven't worked with access databases in a long time.
-
Sep 24th, 2005, 07:08 AM
#3
Thread Starter
Fanatic Member
Re: Microsoft Indexing Service query by date
kleinma,
Thank you for your response. I don't believe Index Index Server is a database of the types your thinking (Access, Oracle, MS SQL Server, MySQL, etc..) Indexing Service is a service in XP and 2000 only. I am thinking Microsoft does create some type of method like a database in the location you provide when setting up a new Catalog. But I believe the query language is just a bit different then say a T-SQL or SQL used in Microsoft Access. However, I hope I am wrong.
-
Sep 28th, 2005, 08:05 AM
#4
Thread Starter
Fanatic Member
Re: Microsoft Indexing Service query by date
Well, I think we figured out what the proper way to handle dates:
VB Code:
Dim d as DateTime
....
sString = txtSearch.Text.Replace("'", "''")
sString = sString.Replace(";", vbNullString)
sURL = "SELECT doctitle, filename, rank, access FROM scope() "
If radBasic.Checked = True Then
sURL &= "WHERE FREETEXT('" + sString + "') "
Else
sURL &= "WHERE CONTAINS('" + sString + "') "
End If
If sStartDt.Length > 0 AND sEndDt.Length > 0 THen
sDtFormat = "yyyy-MM-dd"
d = txtStartDt.Text
sStartDt = d.ToString(sDtFormat)
d= txtEndDt.Text
sEndDt = d.ToString(sDtFormat)
sURL &= "AND (Write > '" & sStartDt & "' AND Write < '" & sEndDt & "') "
End If
-
Sep 28th, 2005, 08:18 AM
#5
Re: Microsoft Indexing Service query by date [RESOLVED]
I still think you should be able to use between syntax
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|