DateTime parameters in ADOQuery
- From: "Alan T" <alanpltseNOSPAM@xxxxxxxxxxxx>
- Date: Tue, 29 May 2007 13:21:58 +1000
I got a strange problem about the DateTime field in MSAccess.
A field in the Access table defined as DateTime, I have the SQL in ADOQuery
SELECT *
FROM Employee
WHERE (DateHired > :StartRange)
AND (DateHired <= :EndRange)
This is my code:
QryEmployee.Close;
QryEmployee.Parameters.ParamByName(StartRange).Value :=
dtThisMonthStocktakeDate;
QryEmployee.Parameters.ParamByName(EndRange).Value :=
dtNextMonthStocktakeDate;
QryEmployee.Open;
if QryEmployee.Eof then
showmessage('no employee');
I found that it always return no employee.
I also checked that the parameter value I passed are correct, eg
1/03/2007 and 1/06/2007
It should have employee return by checking the tables it has employee in
this range.
Any idea?
.
- Follow-Ups:
- Re: DateTime parameters in ADOQuery
- From: Brian Bushay TeamB
- Re: DateTime parameters in ADOQuery
- From: Kevin Frevert
- Re: DateTime parameters in ADOQuery
- From: Del Murray
- Re: DateTime parameters in ADOQuery
- Prev by Date: Re: Delete record in batch mode
- Next by Date: Re: Delete record in batch mode
- Previous by thread: Delphi 5 and ADO
- Next by thread: Re: DateTime parameters in ADOQuery
- Index(es):
Relevant Pages
|