none
Searching on both time and date

    Question

  • I have a MOSS 2007 server with a web app on it. We are using the advanced search web part to search the web app or specified scopes. We need to, however, be able to search on time as well as date, i. e., 11/10/11 10:00 AM.

    Is there any way to set the web part to allow searching using both time and date? It currently will not allow us to input both. It searches only when date is input alone.

    • Moved by Mike Walsh FIN Saturday, January 21, 2012 4:30 AM Clearly a question about Search. As such it goes to the Search forum (provided it is pre-SP 2010) (From:SharePoint - Design and Customization (pre-SharePoint 2010))
    Thursday, November 10, 2011 9:01 PM

All replies

  • Hi cwhitelm,

    I could reproduce this issue, it seems that it could be only input the date.

     

    I am trying to involve someone familiar with this topic to further look at this issue, there might be some time delay. Appreciate your patience.

     

    Thank you for your understanding and support.

     


    Regards, Daniel
    Tuesday, November 15, 2011 11:41 AM
  • I appreciate your time. I did not know if there is a way of adding a query to the properties or something to resolve the issue. So far, I have not come up with anything. Thank you for your continued efforts.

    Cindy

    Tuesday, November 15, 2011 2:06 PM
  • Hello Cindy,

     

    I am able to reproduce the behavior , when I specify the date and time i.e : 11/10/11 10:00 AM, result page returns an error "Incorrect date format". It looks to be a by design behavior without of the box advanced search page.

     

    The advanced search page uses below full text query to retrieve the results. However, the page/webpart  accepts only date as an input and converts to date and time format YYYY-MM- HH:MM:SS .

     

    Full Text Query: SELECT WorkId, Rank, Title, Author, Size, Path, Description, Write, SiteName, CollapsingStatus, HitHighlightedSummary, HitHighlightedProperties, ContentClass, IsDocument, PictureThumbnailURL  from scope() where ("scope" = 'All Sites') And (Created < '2011/11/10 08:00:00')

     

    Conclusion: The OOB advanced search webpart accept only date as input. You  may have to build a custom advanced search web part which can accept datetime input and convert it to YYYY-MM- HH:MM:SS before sending it to search service.

     

    Additional info:  "http://blogs.msdn.com/b/sowmyancs/archive/2009/09/25/important-point-need-to-remember-while-working-with-datetime-filtering-values-in-fulltextsqlquery.aspx"


    Regards,
    Manas Biswas
    Microsoft Online Community Support


    Please remember to click 'Mark as Answer' on the post that helps you or click 'Unmark as Answer' if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, November 28, 2011 9:13 AM
  • Thank you Manas for your time and effort. I had come to the same conclusion and am working on exactly that. I am having one small issue though. I am able to get the web part to search on date time in English, but not in Middle Eastern languages. Is there a trick to making that happen? I had tried using something along the lines of:

    CultureInfo ci = new CultureInfo("ar-SA");

    DateTime dt = Convert.ToDateTime(inputTextBox, ci);     // inputTextBox allows the user to input the date and time in Hindi numerals to be searched on.

    But I get a very uninformative error stating that the web part has caused an error. Any thoughts on how to convert a date time in a Middle Eastern language?

    Thanks, Cindy

    Monday, November 28, 2011 1:49 PM
  • Hello Cindy,

    As per my understanding you want to convert from Hindi numeral to ar-SA. Please let me know if that is not the case. Also can you give me exact value you want to enter in inputTextBox.

    Thanks!! 


    Regards,
    Manas Biswas
    Microsoft Online Community Support


    Please remember to click 'Mark as Answer' on the post that helps you or click 'Unmark as Answer' if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, November 30, 2011 5:41 AM
  • What I need to do is take a Hindi numeral input and convert it to a DateTime object. Similar to doing the following:

    string date = "11/27/2011 8:56 AM";

    DateTime dt = Convert.ToDateTime(date);

    The user will be allowed to input the date and time in Hindi numerals. I need to be able to convert it to a DateTime object.

    Thanks, Cindy


    • Edited by cwhitelm Wednesday, November 30, 2011 11:14 PM
    Wednesday, November 30, 2011 11:09 PM
  • Hi Cindy,

    Can you post the specific error you receive, or better yet debug the webpart and see what specific exception is being thrown?

     

    Thanks,


    David Wilborn MSFT
    Friday, January 20, 2012 4:52 PM