BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Select query between two datetimes

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
siraj
Guest





PostPosted: Fri Oct 22, 2004 12:59 pm    Post subject: Select query between two datetimes Reply with quote



Hi!
I am using c++ builder 5 and MS access 2000.
I connect to access using ADO components.
I am having a problem with select query.
The query is
SELECT ts, conc, fh, fhh, comment FROM archive WHERE (ts between
#10/14/2004 11:24:17 # And #10/20/2004 13:1:42#);

If I open Access 2000 and create a request with the above query,I can see
the result.
But when i execute the same query from C++ builder using TADOQuery
component, I get the error "Parameter object is improperly defined.
Inconsistent or incomplete information was provided."

In c++ builder, if execute the query as
SELECT ts, conc, fh, fhh, comment FROM archive WHERE (ts between
#10/14/2004# And #10/20/2004#);
I have no error and can see the result set.

But I want the query to filter not on date but on datetime. How to enclose
datetime in query .
Please Help,
Thank you in advance
Regards,
Siraj


Back to top
siraj
Guest





PostPosted: Fri Oct 22, 2004 3:16 pm    Post subject: Re: Select query between two datetimes Reply with quote



Hi!
Found the Solution on the net.
I have to put the datetimes value in parameters property of the TDAOQuery.
Regards,
Siraj
"siraj" <siraj.sm (AT) omnisens (DOT) ch> a écrit dans le message de
news:4179041c (AT) newsgroups (DOT) borland.com...
Quote:
Hi!
I am using c++ builder 5 and MS access 2000.
I connect to access using ADO components.
I am having a problem with select query.
The query is
SELECT ts, conc, fh, fhh, comment FROM archive WHERE (ts between
#10/14/2004 11:24:17 # And #10/20/2004 13:1:42#);

If I open Access 2000 and create a request with the above query,I can see
the result.
But when i execute the same query from C++ builder using TADOQuery
component, I get the error "Parameter object is improperly defined.
Inconsistent or incomplete information was provided."

In c++ builder, if execute the query as
SELECT ts, conc, fh, fhh, comment FROM archive WHERE (ts between
#10/14/2004# And #10/20/2004#);
I have no error and can see the result set.

But I want the query to filter not on date but on datetime. How to enclose
datetime in query .
Please Help,
Thank you in advance
Regards,
Siraj





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.