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: Help Plz: Sql statement

Re: Help Plz: Sql statement

From: Jim <jim_kangosjarvi_at_hotmail.com>
Date: 21 Mar 2003 02:53:11 -0800
Message-ID: <b2464361.0303210253.343a5487@posting.google.com>


Sorry.

This is production data and date is stored like 1030101 for 01/01/2003 But how to make an report that gives a production report for actions done in a dayspan given by the user
select * from table where (StartDate >= 031201 and StartTime >= 0600) and (EndDate <= 031203 and EndTime =< 0600 Then the production for 0031202 aint included coz the starttime is not fullfilled.
I could leave out time but production done at the end date after 0600 should not be included. same goes for production done before 0600 startdate

regards Jim

"Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote in message news:<3e75da7f$0$21987$ed9e5944_at_reading.news.pipex.net>...
> please tell me this is a college assignment, in production your date fields
> should be dates.
> Meanwhile look at the to_date function.
>
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
> "Jim" <jim_kangosjarvi_at_hotmail.com> wrote in message
> news:b2464361.0303170541.4126ddba_at_posting.google.com...
> > Hi
> >
> > I want to create a sql query that receives data from a table that
> > looks like this
> >
> > Action xxxxx
> > StartDate yymmdd
> > StartTime hhmm
> > EndDate yymmdd
> > EndTime hhmm
> >
> > Ex. what it can contain
> > X1
> > 031201
> > 0900
> > 031201
> > 1000
> >
> > X2
> > 031202
> > 0300
> > 031202
> > 0400
> >
> > X2
> > 031303
> > 1100
> > 031203
> > 1200
> >
> > select * from table where (StartDate >= 031201 and StartTime >= 0600)
> > and (EndDate <= 031203 and EndTime =< 0600
> >
> > Sql statement should give all rows
> > but X2 wont be given back because StartTime fails, but it should
> > because the action is done day between start date and end date.
> >
> > How should this sql look like?
> >
> > Regards Jim
Received on Fri Mar 21 2003 - 04:53:11 CST

Original text of this message

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