Trim the timestamp from DateTime using OQL query

0
Hello all, I am trying retrive the data which is equal to the given input date using OQL Query.In this case, am not getting any output for the available input date in the database.Here we are trying to match the two different formats thats why we are not getting the correct output(2022-12-31 04:00:00.000=2022-12-31).Can you guys please tell me the exact format function to trim the timestamp part from the DateTime using OQL query.I will attach some sample queries which we used in our application.   OQL Query: Select te.TEST_Id,te.TEST__NBR,te.TEST_NME,te.TEST_DATE   from TestApp.TEST_Table    left join te/gTEST.TEST_Dis/MasterData.Dis ed    left join te/gTEST.TEST_Cry/MasterData.Cry ec   left join te/gTEST.TEST_Ctre/MasterData.Ctre tc  where  te.NEWDATA_FLAG = 'Y'  AND   te.ACTIVE_FLG = 'Y' and (te.TEST_DATE='2024-03-18' ) ORDER BY te.TEST_NBR LIMIT 5000   (In Database,TEST_DATE Data is in the format of  2024-03-18 04:00:00.000)    
asked
1 answers
0

Hi Pravalika,

 

Format the date as shown below and pass it to your oql query to retrieve the data.

 

formatDateTime({yourdate},'yyyy-MM-dd''T''HH:mm:ss.SSSZ')

 

Hope it helps!!!

answered