2008 Nov 24 12:18 PM
Hi all,
Can u help me in writing following select query.
select * from zu1cd_corr where time_stamp between firstday and lastday .
In the above query time_stamp contains the date and time.
where as firstday and lastday contains the dates.
I need to compare the date in the time_stamp with the firstday and lastday.
But time_stamp contains the time also and it is char of 14 characters length.
2008 Nov 24 12:23 PM
Hi,
Then split the time stamp into date and time and put in variables and then write ur query..
lv_date = time_stamp+0(8).
lv_time = time_stamp+8(6).
if lv_Date GT Firstday AND lv_Date LT Lastday
select * from zu1cd_corr into table it_zu1cd_corr.
endif.
Regards,
Nagaraj
2008 Nov 24 12:22 PM
Hi,
You can write where condition "date GE lowervalue and date le highervalue"
"time GE lowervalue and time le highervalue"
2008 Nov 24 12:23 PM
Hi,
Then split the time stamp into date and time and put in variables and then write ur query..
lv_date = time_stamp+0(8).
lv_time = time_stamp+8(6).
if lv_Date GT Firstday AND lv_Date LT Lastday
select * from zu1cd_corr into table it_zu1cd_corr.
endif.
Regards,
Nagaraj
2008 Nov 24 12:25 PM
2008 Nov 24 12:31 PM
Hi,
Concatenate the time 000000 to the firstday and 240000 to the lastday. This way you will get everything that is between first day starting at midnight until last day midnight.
regards,
Advait
2008 Nov 24 12:46 PM
Hi,
If that is the case u can do as advait specified....
if the firstday and secondday are select-options then declare two more variables having 14 character length and then concatenate '000000' to firstday variable and '240000' to last day variable and then write ur query.
CLEAR : lv_firstday,
lv_lastday.
concatenate firstday '000000' to lv_firstday.
concatenate lastday '240000' to lv_lastday.
ranges : r_Date for zu1cd_corr-time_stamp.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_Date-low = lv_firstday.
r_Date-high = lv_lastday.
append r_date.
select * from zu1cd_corr into table it_zu1cd_corr where time_stamp in r_Date.
I hope it helps.
Regards,
Nagaraj
2008 Nov 24 12:44 PM
Hey leela,
*First select all the data from zulcd_corr table.
select * from zu1cd_corr into table it_zu1cd_corr.
*then,
loop at it_zu1cd_corr where ls_zu1cd_corr.
*Then split the time stamp into date and time and put in variables and then write ur query..
lv_date = ls_zu1cd_corr-time_stamp+0(8).
lv_time = ls_zu1cd_corr-time_stamp+8(6).
*check as per your condition
if lv_Date GT Firstday AND lv_Date LT Lastday
*append it to another internal table.
endif.
endloop.
i hope this will solve your problem.
Regards,
N M Poojari.