1

Hi I'm trying to filter data fields from a paradox database table (from information system on programmed on delphi)...

I successfully made the connection with the connection string:

Provider =Microsoft.Jet.OLEDB.4.0; Data Source =c:\bddir; Extended Properties =Paradox 5.x;

I can even successfully execute queries like select * from mytable

But when I'm trying to do queries like:

SELECT * FROM entries WHERE date = '2011-1-1' thru a c# application with the cxstr

above.. and it said: Data type mismatch in criteria expression

any solutions?? I tried things like StrToDate or QuotedStr and it didn't work...

:(

antyrat
  • 27,479
  • 9
  • 75
  • 76
christian
  • 21
  • 3

2 Answers2

3

Try

SELECT * FROM entries WHERE date = #1/1/11#

instead of

SELECT * FROM entries WHERE date = '2011-1-1'

look here: MS-TechNet

antyrat
  • 27,479
  • 9
  • 75
  • 76
1

Finally I got it it's:

SELECT 
  * 
FROM 
  table 
WHERE 
  year(dateField) >= 2011 AND 
  month(dateField) >= 1 AND 
  day(dateField) >= 1 

Hope it helps you!!

antyrat
  • 27,479
  • 9
  • 75
  • 76
christian
  • 21
  • 3