Subject | Re: [firebird-support] error formating date in stored procedure |
---|---|
Author | Teträm Corp |
Post date | 2007-08-07T22:26:09Z |
salenowon99 a écrit :
substring(mydate from 3 for 2) || '-' || substring(mydate from 1 for 2)
|| '-' || substring(mydate from 5 for 4)
assuming mydate is "dd/mm/yyyy" this should return "mm-dd-yyyy"
Thierry
> now after looking through the various newsgroups and assorted posts, Iyou could do something like that
> know that I need to somehow convert that string from dd/mm/yyyy into
> mm-dd-yyyy so that firebird can understand it. (Something I've done in
> delphi more than once). But I've got no idea how to do this inside a
> firebird stored procedure. I've found lots of vague references to
> various udf functions and I've tried getting the CAST or EXTRACT
> functions to work, but with no success.
>
substring(mydate from 3 for 2) || '-' || substring(mydate from 1 for 2)
|| '-' || substring(mydate from 5 for 4)
assuming mydate is "dd/mm/yyyy" this should return "mm-dd-yyyy"
Thierry