Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: HH:MM if today, else Mon, DD in SQL?

Re: HH:MM if today, else Mon, DD in SQL?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 5 Apr 2000 07:08:50 +0200
Message-ID: <954912231.12213.2.pluto.d4ee154e@news.demon.nl>


decode(time_due, sysdate, to_char(time_due,'HH-MM'), to_char(time_due, 'DD'))
should be all.

Hth,

Sybrand Bakker, Oracle DBA

Otis Gospodnetic <otis_at_my-deja.com> wrote in message news:8ce9lr$gkb$1_at_nnrp1.deja.com...
> Hi,
>
> I have a table that has a column with dates.
> When I get rows from that table I would like to be able to show hours
> and minutes if the date happens to be the current date(i.e. today);
> otherwise I would like to display month and day.
>
> For example, say that I'm displaying something like a to-do list:
>
> task time due
> ----------------------
> meet Jackie 01:37
> wake up 09:56
> buy shoes April 10
> go to Jelsa April 01
> ...
>
> Is this doable in SQL without stored procedures and without post
> processing of result set (comparing retrieved dates with current date)?
>
> Thank you,
>
> Otis
> P.S.
> Hmm...looks like an SQL question....but I am running Oracle 8.1.5.0.2
> on Linux actually :)
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Received on Wed Apr 05 2000 - 00:08:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US