Thanks Jean ,it worked but I am getting all error log ,my requirement is to get only latest error can you suggest some filtering conditionI am trying to use max(logdate) or max(@id) conditions but dont know syntax how to impelement, if there is any other way please suggest.