Results 1 to 5 of 5

Thread: Microsoft Indexing Service query by date [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    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.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    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.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: Microsoft Indexing Service query by date

    Well, I think we figured out what the proper way to handle dates:

    VB Code:
    1. Dim d as DateTime
    2. ....
    3. sString = txtSearch.Text.Replace("'", "''")
    4. sString = sString.Replace(";", vbNullString)
    5.  
    6. sURL = "SELECT doctitle, filename, rank, access FROM scope() "
    7. If radBasic.Checked = True Then
    8.   sURL &= "WHERE FREETEXT('" + sString + "') "
    9. Else
    10.  sURL &= "WHERE CONTAINS('" + sString + "') "
    11. End If
    12.  
    13. If sStartDt.Length > 0 AND sEndDt.Length > 0 THen
    14.   sDtFormat = "yyyy-MM-dd"
    15.   d = txtStartDt.Text
    16.   sStartDt = d.ToString(sDtFormat)
    17.   d= txtEndDt.Text
    18.   sEndDt = d.ToString(sDtFormat)
    19.   sURL &= "AND (Write > '" & sStartDt & "' AND Write < '" & sEndDt & "') "
    20. End If

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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
  •  



Click Here to Expand Forum to Full Width