05-04-2006 5:00 PM
Hi all
I need to display all the records which are created between some time period...like ..
all the records created from 01-01-2005 morning 10 am to 01-02-2005 evening 5 o clock
how the select stament should be?
thanks in advance.
sai
05-04-2006 5:06 PM
Hi,
You need to have the created date and time in the table.
Then
SELECT * from table
where create_date between '01012005' and '01022005'
and create_time between '100000' and '170000'.
Regards,
Ravi
Note : Please mark the helpful answers
05-04-2006 5:06 PM
Hi,
You need to have the created date and time in the table.
Then
SELECT * from table
where create_date between '01012005' and '01022005'
and create_time between '100000' and '170000'.
Regards,
Ravi
Note : Please mark the helpful answers
05-04-2006 5:08 PM
i dont think it will work. coz with this statement we can not select the record which is created on 02-01-2005 morning 8 o clock
got my point?
thanks
sai
05-04-2006 5:20 PM
You are right .. in that case use this
SELECT * from table
where ( create_date = '01012005' and create_time > '100000' )
or ( create_Date = '01022005' and create_time < '170000' ).
Regards,
Ravi
Note : Please mark the helpful answers
05-04-2006 5:07 PM
Does the table have a create time and date? If not, are there change documents for the application that creates entries?
Rob
05-04-2006 5:25 PM
Assuming you have both a create date and time, try:
Select * from whatever
where ( create_date > low_date and
create_date < high_date) or
( create_date = low_date and
create_time >= low_time) or
( create_date = high_date and
create_time <= high_time) .
Messy, but I think it's what you want.
Rob
05-04-2006 5:07 PM
Hi,
Could you come with what are the inputs do you have to proceed further.
Like from which table you are fetching and fields.
Any way look at the example......
SELECT f1 f2 f3 f4 from <DB Table> into table ITAB where
f1 = f1 and
date in s_date and
time in s_time.
Thanks.
05-04-2006 5:10 PM