Re: date functions

From: Scott Mattes <Scott_at_TheMattesFamily.ws>
Date: Tue, 24 Jun 2003 12:24:26 GMT
Message-ID: <_pXJa.16129$Jw6.6888829_at_news1.news.adelphia.net>


[Quoted] For the number of days in a month, one way is

SELECT To_Date( '0601' || To_Char( SYSDATE, 'yyyy' ), 'mmddyyyy' ) -

       To_Date( '0501' || To_Char( SYSDATE, 'yyyy' ), 'mmddyyyy' )   FROM dual;

for finding all prices in affect for May of this year you could

select *
 from table
where to_char( start_date, 'yyyy' ) = to_char( sysdate, 'yyyy' )

   and to_char( end_date, 'yyyy' ) = to_char( sysdate, 'yyyy' ) and '05' between to_char( start_date, 'mm' ) and to_char( end_date, 'mm' );

[Quoted] "Macius The Great" <Maciej.Krych(usun to )_at_telekomunikacja.pl> wrote in message news:bd9bo0$2jk$1_at_nemesis.news.tpi.pl...
> hello :)
>
> is here someone who can tell me how to get numbers of days in month
> simply function which return numbers of days in mounth
> or maybe how to find prices form table:
>
> table :
>
> price | effective_start_date| effective_end_date
>
> I need select all prices efecctive in month of may
> I mean :
>
> ended in may
> started and ended in may
> started in may
>
> any simple solution?
>
> regards
>
> MK
>
>
>
>
Received on Tue Jun 24 2003 - 14:24:26 CEST

Original text of this message