Subject | Re: error formating date in stored procedure |
---|---|
Author | Adam |
Post date | 2007-08-07T23:42:18Z |
--- In firebird-support@yahoogroups.com, "Anderson Farias"
<peixedragao@...> wrote:
Absolutely. In fact if you are doing it in Delphi, it seems a bit
backwards in converting the floating point representation to a string
representation then expecting Firebird to reverse that back into a
floating point or numeric (not sure which it uses) representation.
Something like this:
qry.SQL.Text := 'INSERT INTO mytable (...) VALUES (..., :dt_date);'
qry.ParamByName('dt_date').AsDate := DateTimePicker1.Date;
qry.ExecSQL;
(exact methods are dependent on connection suite).
Adam
<peixedragao@...> wrote:
>can use:
> Hi,
>
> asuming you'll always have these 'string dates' as 'dd/mm/yyyy' you
>easier =)
> cast(
> substring(str_date_field from 1 for 2)||'.'||
> substring(str_date_field from 4 for 2)||'.'||
> substring(str_date_field from 7 for 4)
> as date)
>
>
> ('dd.mm.yyyy' is also a valid format for date 'input' on FB)
>
> of course, if you could do this 'conversion' inside Delphi it'd be
Absolutely. In fact if you are doing it in Delphi, it seems a bit
backwards in converting the floating point representation to a string
representation then expecting Firebird to reverse that back into a
floating point or numeric (not sure which it uses) representation.
Something like this:
qry.SQL.Text := 'INSERT INTO mytable (...) VALUES (..., :dt_date);'
qry.ParamByName('dt_date').AsDate := DateTimePicker1.Date;
qry.ExecSQL;
(exact methods are dependent on connection suite).
Adam