>I am having a problem querying fox 2.6 data from .Net with regards to date
>
>I have a date field in the 2.6 table but cannot seem to figure out how to pass the date in the sql string in a way that wil just return dates that match today's date. I can get all data just fine but with the date condition I return no data. Below is an snippet of the code
>
>
> Try
> Dim lcsql As String = "select * from crdlog where entdate = 05/11/2005" '& Date.Today
> MsgBox(lcsql)
> Dim ocon As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\actionxp\data;Extended Properties=dBASE IV;User ID=Admin;Password=")
> Dim oda As New OleDb.OleDbDataAdapter(lcsql, ocon) '
> oda.Fill(ds)
>
> MsgBox(ds.Tables(0).Rows.Count) 'should be 6 records
> Catch EX As Exception
> Console.WriteLine(EX.Message)
> End Try
>
>
"select * from crdlog where entdate = date()"
If you use VFPOLEDB driver instead (you should):
"select * from crdlog where entdate = date()"
or:
"select * from crdlog where entdate = {^2005/5/11}"
would work (I don't kmow if latter would work with Jet driver).
Cetin