I am using a FullTextSqlQuery to grab some data from a SharePoint instance. Initially I had a fairly simple where clause in which I filtered the results by the content type and everything worked fine.

I then tried to add some date filtering which added a condition like:

 AND mypublishstartdate <= '11/9/2011'

to the end. Unfortunately I am now getting the error:

Error HRESULT E_FAIL has been returned from a call to a COM component.

Exception Details: System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: Error HRESULT E_FAIL has been returned from a call to a COM component.

Does anyone know what I am doing wrong here?

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

Do you have a managed property called mypublishstartdate which has a crawlable property mapped to it?

link|improve this answer
Yes I have that – Abe Miessler Nov 9 '11 at 20:19
Try formatted your date in Year to Day format, then. YYYY-MM-DD. – James Love Nov 9 '11 at 20:22
No more errors! Not getting any records now, but I can figure that out. Thanks! Any idea why that fixes it? – Abe Miessler Nov 9 '11 at 20:27
It's the format datetimes are stored in the database, Year to second, YYYYMMDDTHHmmssZ (also known as ISO8601). – James Love Nov 9 '11 at 20:35
Awesome, you're the man James! – Abe Miessler Nov 9 '11 at 20:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.