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: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Mon, 17 Mar 2003 14:23:55 -0000
Message-ID: <3e75da7f$0$21987$ed9e5944@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 Mon Mar 17 2003 - 08:23:55 CST

Original text of this message

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