Subject | Re: [firebird-support] Casting a Date to a Varchar inverts its format? |
---|---|
Author | Ivan Prenosil |
Post date | 2006-12-08T08:40:34Z |
> select invoicedate from invoicesFirebird sends the date to client. It is the application who formats it,
>
> invoicedate
> -----------
> 01-01-2006
and application can format it as you wish.
> select cast(invoicedate as varchar(10)) from invoicesIn this case you order Firebird to format date itself.
>
> invoicedate
> -----------
> 2006-01-01
Firebird always use yyyy-mm-dd format.
> Date format gets inverted and I don't want this. I need to concatenateJust send timestamp to client application, and do whatever formatting you like, i.e.
> the date field to a varchar "time" field, like this:
>
> invoicedatetime = cast(invoicedate as varchar(10)) || invoicetime;
>
> But the result is:
>
> "2006-01-01 09:21"
>
> Same result if I do this (implicit conversion):
>
> invoicedatetime = invoicedate || invoicetime;
>
> What I need is this:
>
> "01-01-2006 09:21"
>
> What am I missing here and how can I accomplish what I need?
invoicedatetime = invoicedate + invoicetime;
Ivan
http://www.volny.cz/iprenosil/interbase/