Click HERE to see how Saviynt Intelligence is transforming the industry. |
02/12/2024 12:34 AM
Hi Team,
Email History table stores the data of emails which are stuck or the emails failed to send and the data of this emailhistory table stores in UTC ? and can someone provide sample query to fetch the data from the table which are failed in the last one day ?
Thanks,
02/12/2024 01:08 AM
Hi @AravindK
Try using the below query for failed tries of mail items that were generated in the last day
select * from emailhistory where retrycount>0 and STR_TO_DATE(createdate, '%d-%m-%Y %T') >= date_sub(CURdate(),interval 1 day)
If you want to filter based on status as well, refer to the following status codes:
1 - SENDNOW
2- SENT
15 - INPROCESS
404 - ERROR WHILE SEND
02/12/2024 01:24 AM
Hi @armaanzahir ,
Thanks for the response. Tried the above query but not able to execute it in data analyzer ,giving syntax error.
02/12/2024 02:46 AM
Please share the error screenshot. This works for me. Make sure there are no spaces before the select statement of the query.
02/12/2024 05:38 AM
Hi @armaanzahir ,
It is working . But Filters are not working as expected . I have mentioned interval for only one day but it is fetching all the records.
02/12/2024 07:22 AM - edited 02/12/2024 07:22 AM
Hi @AravindK , try this
select * from emailhistory where retrycount>0 and STR_TO_DATE(createdate, '%m-%d-%Y %T') >= curdate()-1
Thanks,
Amit
02/12/2024 08:06 AM