I have written a program and i need to calculate yesterday records(timing 12:00 AM to 05:00 AM) with today records
for each womf_worder of sfcf_au_ship where
womf_worder.word_production_status EQ "B" and
womf_worder.word_build_date EQ today - 1 and
womf_worder.word_build_time GE tt_shift.shft_start_hour and
womf_worder.word_build_time LE tt_shift.shft_stop_hour
no-lock:
assign i = i + 1.
end.
But the problem is I need to calculate the orders only on those mentioned time(12:00 AM to 05:00 AM) with today records. Could you please help this case?
If you know your data doesn't have 'future' dates in it, you could use something like this:
for each womf_worder of sfcf_au_ship where
womf_worder.word_production_status EQ "B" and
womf_worder.word_build_date GE today - 1 and
womf_worder.word_build_time GE tt_shift.shft_start_hour and
womf_worder.word_build_time LE tt_shift.shft_stop_hour
no-lock:
assign i = i + 1.
end.
If you are not familiar with the data you are working with or want it to be more portable:
for each womf_worder of sfcf_au_ship where
womf_worder.word_production_status EQ "B" and
womf_worder.word_build_time GE tt_shift.shft_start_hour and
womf_worder.word_build_time LE tt_shift.shft_stop_hour and
( womf_worder.word_build_date eq today - 1 or
womf_worder.word_build_date eq today )
no-lock:
assign i = i + 1.
end.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments