ErrorDefinition.Id = Statistics.ErrorDefinitionId and DiffDays(Statistics.ErrorDate, CurrDate()) <= 7

DiffDays(Statistics.ErrorDate, CurrDate()) <= 7 or Statistics.ErrorDefinitionId = NullIdentifier()