Subject | Re: Problems with parameters in subquery |
---|---|
Author | heredia_fer |
Post date | 2006-01-13T17:58:20Z |
> > I have a query which contains a subquery. Subquery receives 2 dateThis is my query:
> > parameters, the problem is that when the query is activated,
> > application raises an exception class EConvertError: "01/01/2006 is
> > not a valid INTEGER value".
> > I don't now why it's an integer value if I'm sending the parameter
> > like a date value. If I execute the same query in ISQL there is no
> > problem.
> > Any suggestion?
>
> Yes. Send queries and metadata. Mind you: this is a Delphi-side
> error, so make sure if the (parameter) types are correct.
>
"Select CFFolEst, CFNumeroEst as Pregunta, CFIdUsu, CFFECHORA,
CFDescCat as Tipo, CFTipoEst, CFValor,
(Select Count(CFFolEst) From TFTExamen, TFCHorExamen
Where TFTExamen.CFFolEst = TFEEstacion.CFFolEst
and TFTExamen.CFFolioEx = TFCHorExamen.CFFolioEx
and TFCHorExamen.CFFecha between :FecIni and :FecFin) as Total
From TFEEstacion, TFCGlobalCat
Where TFEEstacion.CFTipoEst = TFCGloBalCat.CFCodCat
and CFCodTema =:Codigo
Group by CFFolEst, CFNumeroEst, CFIdUsu, CFFecHora, CFDescCat,
CFTipoEst, CFValor"
Metadata:
TFCHorExamen.CFFecha DATE not null
CFCodTema INTEGER not null
This is the Delphi code for retrieving data from the query:
IBOQuery1.ParamByName('FecIni').asDate := StrToDate('01/01/2005');
IBOQuery1.ParamByName('FecFin').asDate := StrToDate('03/01/2005');
IBOQuery1.ParamByName('Codigo').Value := 98;
IBOQuery1.Active := True;
I already checked the types and they're correct. So, I don't know
what's the problem. Maybe my Delphi code...