Board index » delphi » ADORecordset and Filter problem?!

ADORecordset and Filter problem?!

Hi,

I have updated my app to use ADORecordset instead of of TKaDAO table
component.
When I try to use this filter I get an error :

ADORecordset.Filter := "SomeField Like '*02*' AND #06/10/2003 13:50:42# >
SomeDateTimeField"

What is wrong?

--
Many regards,

Bonny Gijzen
TB Systems
Holland

 

Re:ADORecordset and Filter problem?!


I have narrowed the problem down to the datetime value: #06/10/2003
13:50:42#

It seems ADO cannot handle it.
(while DAO didn't have any problems with it)

How must I format a field representing a DateTime value?

--
Many regards,

Bonny Gijzen
TB Systems
Holland

Quote
"Bonny Gijzen" <bonny.gij...@q-lite.net> wrote in message

news:3ee5c62a$1@newsgroups.borland.com...
Quote
> Hi,

> I have updated my app to use ADORecordset instead of of TKaDAO table
> component.
> When I try to use this filter I get an error :

> ADORecordset.Filter := "SomeField Like '*02*' AND #06/10/2003 13:50:42# >
> SomeDateTimeField"

> What is wrong?

> --
> Many regards,

> Bonny Gijzen
> TB Systems
> Holland

Re:ADORecordset and Filter problem?!


Quote
>ADORecordset.Filter := "SomeField Like '*02*' AND #06/10/2003 13:50:42# >
>SomeDateTimeField"

try

ADORecordset.Filter := 'SomeField Like '
quotedStr('%02%')+' AND SomeDateTimeField <= '+quotedStr('06/10/2003 13:50:42');
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:ADORecordset and Filter problem?!


"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:149dev0pgjakvekcdbbdlbkoh57iptkmt0@4ax.com...
Quote
> try

> ADORecordset.Filter := 'SomeField Like '
> quotedStr('%02%')+' AND SomeDateTimeField <= '+quotedStr('06/10/2003

13:50:42');

Hey, that works ?!?!

It seems that SomeDateTimeField must come first, and then the date time
value itself.
Is there logic to that?
(Or is there some documentation describing this ?)

Thanks again !

Bonny,

Re:ADORecordset and Filter problem?!


Quote
>It seems that SomeDateTimeField must come first, and then the date time
>value itself.
>Is there logic to that?

I believe it is the ANSI SQL standard
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads