Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help Plz: Sql statement
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...Received on Mon Mar 17 2003 - 08:23:55 CST
> 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
![]() |
![]() |