Re:SQL Searching date field
Wayne,
Thank you for your reply I have tried parameters but still keep getting the
error message ' Type Mismatch in Expression, as though the data type 'Date'
in SQL does not match data type 'Date', in the paradox field. If I set the
data type to 'String' you can open the Query but there is no data, again the
field not being recognised.
Grrrr......
I have now pulled out great clumps of hair. I am wondering if there is a
glitch somewhere, but I can not see where.
Quote
> Use parameters in your TQuery. The SQL Text should be:
> select * from TableName
> where "Invoice Date" = :invoicedate;
> From then on you only need to set the date value in the parameter:
> Query1.Close; // important, must close
> Query1.Params.FieldByName('invoicedate').AsDateTime :=
> SomeDateTimeVariable;
> Query1.Open;
I think you will find that ,
Query.Params[0].AsDateTime := "Whatever"
works here better, the [0] being the first parameter called in the Parameter
name definitions listing.
Quote
> --
> Wayne Niddery - WinWright Consulting
> RADBooks - http://members.home.net/wniddery/
Liked the site.
Thanks
Marcus.