Subject Re: [firebird-support] error formating date in stored procedure
Author Teträm Corp
salenowon99 a écrit :
> now after looking through the various newsgroups and assorted posts, I
> 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.
you could do something like that

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"