Re: SQL "Select" help needed

From: <frank_delisle_at_hotmail.com>
Date: Thu, 28 Jan 1999 13:30:24 GMT
Message-ID: <78popg$502$1_at_nnrp1.dejanews.com>


This will give you today's date at 6am:
to_date(to_char(sysdate,'YYYY-MM-DD')||' 06:00','YYYY-MM-DD HH24:MI') This will give you yesterday's date at 6pm:
to_date(to_char(sysdate-1,'YYYY-MM-DD')||' 18:00','YYYY-MM-DD HH24:MI')

You should be able to continue from there. Good luck! In article <36AF6FF0.1BDA_at_pg.com>,
  robert prater <praterrd_at_pg.com> wrote:
> I'm using SQL code in an excel macro to extract production data from
> Oracle.My select statement uses two variables recieved from the
> equipment operator by way of an InputBox.(begin and end dates)
> I want this macro to run automatically twice a day (6am and 6pm).It
> will execute the SQL code,but the operator will no longer put in begin
> and end times thru the input box (it's going to select statement).
> Is there a way for me to hard code times, but have date pickup today's
> date or yesterday's date and use it in select statement?
>
> For example: shift 1 = (today's date) 6 am to (today's date) 6 pm
> shift 2 = (yesterday's date) 6 pm to (today's date) 6 am
>
> (Our plant went to 12 hr. shifts)
> I shouldn't have any problems getting the macro started automatically,
> just the "select" statement.
>
> (just a newby) --Ziggy--
>

Frank Delisle
Consultant, Eds Québec
e-mail: francois.delisle_at_prosig.qc.ca "Un problème sans solution n'est pas un problème"

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Jan 28 1999 - 14:30:24 CET

Original text of this message