Re: how to get the date range

From: Ed Prochak <>
Date: Tue, 21 Oct 2008 11:00:39 -0700 (PDT)
Message-ID: <>

On Oct 21, 2:29 am, wrote:
> Hello Everyone
> I have a problem to define the date range. Firstly, this is my sql
> statement:
> define date_start = '20080801';
> define date_end = '20080901';
> select hostname, to_char(to_date(&date_start, 'YYYYMMDD') , 'YYYY'),

> i have defined date_start as 20080801 and date_end as 20080901. So
> that is mean the statistics_date month is equal to the previous month.
> My problem is however, how will i get the date_start and date_end
> values? In my sql samples, they are still hardcoded. I cannot hardcode
> the values for date_start and date_end it in the script. The script
> should be able to know how to get the date range for the previous
> month, or the previous year. Any ideas?

I have an idea on how to control model railroad trains. Want to hear it?
(Well you did say "Any ideas?" 8^)

How are you running the script? toad? sql*Plus? PERL DBI? Pro*C? The answer depends on how you are running the query.

Assuming SQL*Plus, look up ACCEPT in the fine user manual. And BTW, also pay attention to the advice Jim and Sybrand gave you.

   Ed Received on Tue Oct 21 2008 - 13:00:39 CDT

Original text of this message