Subject | Re: [firebird-support] COALESCE |
---|---|
Author | Arno Brinkman |
Post date | 2004-06-16T16:52:56Z |
Hi,
if FieldByName('SomeDate').IsNull then
begin
Result := 'not defined';
end else begin
Result := FormatDateTime('DD.MM.YYYY',
FieldByName('SomeDate').AsDateTime);
end;
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> > Well, I guess IBO is creating a text-column. Not a date-one.You could so the NULL translating in your client, something like:
> > This makes sense - how would you format a date that says
> > 'not defined'
>
> You are right. When I do COALESCE(Z_Date, NULL), the date
> is displayed correctly.
>
> > If you want to format the date to your particular displayformat,
> > you have to do it yourself.
>
> It's a bit OT here, but do you know a good way to modify IBO's way
> of making up fields? My application is non-visual, so I cannot use
> all the opportunities of the visual components.
if FieldByName('SomeDate').IsNull then
begin
Result := 'not defined';
end else begin
Result := FormatDateTime('DD.MM.YYYY',
FieldByName('SomeDate').AsDateTime);
end;
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://80.126.130.81