Discussion:
Indexing service Query help in asp.net ( c#)
(too old to reply)
Parvez
2006-11-08 05:57:33 UTC
Permalink
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL OF
\"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";

Above given is my indexing service query. I have written this to get files
between two dates that it has created. I am geting wrong results and many
files are not dispalyed. If i remove the Date condintion in the where clause
i am getting the deasired result . Later I added @ near create like shown
below

string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
OF \"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (@Create >= '"
+ FromDate.ToString("yyyy/MM/dd") + "' AND @Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";

This gave me an error:
System.Data.OleDb.OleDbException: Incorrect syntax near '@'. Expected '(',
NOT, CAST, CONTAINS, CREATE, FREETEXT, MATCHES, ID. SQLSTATE=42000 at
downloadECN1.FillDataSet(String Connect, String Command, String TableName) at
downloadECN1.GetEcnDetails(DateTime FromDate, DateTime ToDate) at
downloadECN1.btnECNSearch_Click(Object sender, EventArgs e).

Please help me in this matter
Thanks in advance
Parvez Mohamed
Hilary Cotter
2006-11-08 10:47:46 UTC
Permalink
Your query is for the creation dates of the files. Are you sure you are not
looking for the last modified date (the write property)?
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
Post by Parvez
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL OF
\"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
Above given is my indexing service query. I have written this to get files
between two dates that it has created. I am geting wrong results and many
files are not dispalyed. If i remove the Date condintion in the where clause
below
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
NOT, CAST, CONTAINS, CREATE, FREETEXT, MATCHES, ID. SQLSTATE=42000 at
downloadECN1.FillDataSet(String Connect, String Command, String TableName) at
downloadECN1.GetEcnDetails(DateTime FromDate, DateTime ToDate) at
downloadECN1.btnECNSearch_Click(Object sender, EventArgs e).
Please help me in this matter
Thanks in advance
Parvez Mohamed
Parvez
2006-11-08 11:21:02 UTC
Permalink
I am specifically looking for create date. These files are non editable
.So will the create date be equal to write( even if it is viewed many times)
Post by Hilary Cotter
Your query is for the creation dates of the files. Are you sure you are not
looking for the last modified date (the write property)?
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
Post by Parvez
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL OF
\"/cus/" + Session["sBrokerCode"].ToString() + "\"') Where (Create >= '" +
FromDate.ToString("yyyy/MM/dd") + "' AND Create<= '" +
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
Above given is my indexing service query. I have written this to get files
between two dates that it has created. I am geting wrong results and many
files are not dispalyed. If i remove the Date condintion in the where clause
below
string Command = "Select FILENAME,CREATE,VPATH from SCOPE('DEEP TRAVERSAL
ToDate.ToString("yyyy/MM/dd") + "') AND (FILENAME like '" + ClientName + "%')
Order By Create";
NOT, CAST, CONTAINS, CREATE, FREETEXT, MATCHES, ID. SQLSTATE=42000 at
downloadECN1.FillDataSet(String Connect, String Command, String TableName) at
downloadECN1.GetEcnDetails(DateTime FromDate, DateTime ToDate) at
downloadECN1.btnECNSearch_Click(Object sender, EventArgs e).
Please help me in this matter
Thanks in advance
Parvez Mohamed
Loading...