04-06-2018 10:36 AM
Dear All,
I have a question regarding to ABAP where statement. in my table I have a field that is CreatedTimestamp of record, But I need to read the data that are created today(Based on system time obviously)
My requirement is to
Select * from Ztable where (CreatedTimestamp is today)
Any help will be appreciate.
Thanks
04-06-2018 11:02 AM
04-06-2018 11:13 AM
Hi Horst,
Thanks for your reply,
But I dont know how should I can achieve my requirement... I am not going to convert my timestamp to any other value.
I want to say this phrase: CreatedTimestamp is between (CurrentTimestamp -00:01 AND CurrentTimestamp -23:59)
Something like below:
TSTMP_SECONDS_BETWEEN( tstmp1, tstmp2, on_error )
But I dont know how can I write it and how can I say Today at 00:01 until today 23:59
Could you please help me about this?
04-06-2018 11:23 AM
04-09-2018 4:10 PM
Hi,
You could generate two timestamps, one representing 12:00AM TODAY and another representing 11:59PM TODAY, then write your query as...
SELECT *
FROM Ztable
WHERE CreatedTimestamp BETWEEN low_timestamp AND high_timestamp.
Cheers,
Amy
04-10-2018 2:17 PM
Hi Amy,
Thanks a lot for your response,
I knew that I should write between, but I do not know how can I write "12:00AM TODAY" and "11:59PM TODAY"
This is my question.
Could you please help me about this?
Thanks
Sin
04-10-2018 3:15 PM
Hi Sin,
Take a look at the ABAP documentation for CONVERT INTO TIME STAMP. You can use this to create your LOW and HIGH timestamps for use in the SQL query.
Cheers,
Amy