Subject Re: Date parameters
Author Santiago
Thank you Helen

--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 11:10 PM 30/10/2003 +0000, you wrote:
> >Hi,
> >
> >I have a stored proc that receive date parameters, that will be
used
> >for a "select" statement.
> >
> >I'm calling the stored proc as:
> >
> >select * from factura_relacion
('IMPORTE', '01.01.2005', '01.01.2001')
> >
> >What is the correct format to specify dates in a function call like
> >this in ISQL ? Is it correct as written?
>
> If it works without an exception, then it is correct. If you get
an
> exception, it means you need to use CAST(). This depends on
dialect. For
> Dialect 3, you may need to do this for date literals:
> select * from factura_relacion('IMPORTE', CAST ('01.01.2005' AS
> DATE), CAST ('01.01.2001' AS DATE))
>
>
> >(The next question is a bit Delphi related, and is about the same
> >stored proc function call; sorry for any inconvinience )
> >
> >If I call it from Delphi, should I pass the dates as text, or as a
> >TDate value?
>
> TDateTime, and use the AsDateTime method. This is better than
passing
> literals in Delphi because it avoid the local problems with
Firebird's
> non-compatible date literal formats and messing about with
EncodeDate and
> DecodeDate.
>
> heLen