select MS.ID from MsgSent MS join MsgToRead MTR on MTR.MsgSent_ID = MS.ID where MTR.TargetUser_ID = :User_ID and (MS.ValidToDate$Date = 0 or MS.ValidToDate$Date >= :ActualDateTime) and MTR.Deleted = 'N' and MTR.HaveRead = 'N'
Generated by ABRA Software a.s. 27.10.2021 16:35:16