Subject | Re: [IBO] Dates in TIBOQuery vs. PrepareSQL |
---|---|
Author | Tony Masefield |
Post date | 2005-10-12T15:35:38Z |
--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...> wrote:
apostrophe. Now working fine. This construct is a little peculiar
(at least to me).
Thanks for the help.
Tony
>wrote:
> > --- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...>
> > >running
> > > > Hi All,
> > > >
> > > > Somewhat confused. If I enter:
> > > >
> > > > Where (Reading_Time > (Cast('2005/10/05' As Date)))
> > > >
> > > > into a TIBO Query then I get the anticipated result.
> > > >
> > > > However if I add:
> > > >
> > > > SQLWhereItems.Add('(Reading_Time > (Cast('2005/10/05' As
> > Date)))');
> > >
> > > try
> > > SQLWhereItems.Add('(Reading_Time > (Cast(''2005/10/05'' As
> > Date)))');
> > >
> > Thanks for the reply Alan.
> > Have tried your suggestion. The program compiles and starts
> > but then get the message "Column Unknown 2005/10/05" from IBO.but
> > Any more suggestions?
> > Suppose I should add that the Reading_Time field is a Timestamp
> > read somewhere that the Date/Timestamp conversions are "OK" sodoubt
> > that is the problem (anyway it runs in the SQL for the query OK).date - I
>
> you would get "column unknown" if you put double quotes around the
> want you to put 2 single quotes.Thanks Alan, missed the two single apostophes vs. the double
> i.e. NOT "
> but ''
>
> Alan
>
apostrophe. Now working fine. This construct is a little peculiar
(at least to me).
Thanks for the help.
Tony
> > >__________________________________________________________________
> > > > to the same query OnPrepareSQL I get the message:
> > > >
> > > > [Error] DM_Unit.pas(74): Incompatible types: 'String'
> > and 'Extended'
> > > >
> > > > BTW, I'm using Delphi 5 Pro.
> > > > Any suggestions or references to handling dates with TIBO?
> > > >
> > > > Regards,
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> > > > _________Firebird
> > > > IB Objects - direct, complete, custom connectivity to
> > orlayer.
> > > > InterBase
> > > > without the need for BDE, ODBC or any other
> > > >__________________________________________________________________
> >
> > > > _________Tech
> > > > http://www.ibobjects.com - your IBO community resource for
> > > > Info papers,__________________________________________________________________
> > > > keyword-searchable FAQ, community code contributions and
> > more !
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> > ___________________________________________________________________________
> > IB Objects - direct, complete, custom connectivity to Firebird or
> > InterBase
> > without the need for BDE, ODBC or any other layer.
> >
> > _________
> > http://www.ibobjects.com - your IBO community resource for Tech
> > Info papers,
> > keyword-searchable FAQ, community code contributions and more !
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
>